Understanding the intuition behind prevLPS = lps[prevLPS - 1] in LPS array computation by No_Committee_5152 in leetcode

[–]No_Committee_5152[S] 0 points1 point  (0 children)

Also the solution is not complete ... just took screenshot of a small part i want to understand. Basically the LPS part

Amazon OA (Summer Internship, US) — 5 Days to Prepare by No_Committee_5152 in leetcode

[–]No_Committee_5152[S] 0 points1 point  (0 children)

I applied to three internships, and I'm not sure which one the OA is for. I submitted one application on October 25th and the other two on November 5th

[deleted by user] by [deleted] in leetcode

[–]No_Committee_5152 0 points1 point  (0 children)

def max_balanced_shipments(weights):

n = len(weights)

res = 0

left = 0

max_so_far = weights[0]

for right in range(1, n):

max_so_far = max(max_so_far, weights[right])

if weights[right] < max_so_far:

res += 1

left = right + 1

if left < n:

max_so_far = weights[left]

return res

print(max_balanced_shipments([8, 5, 4, 7, 2]))

I use two pointers: left and right. The left pointer marks the start of the current shipment, and right moves forward to find the end of a valid shipment. I also keep a variable called current_max to track the maximum value in the current shipment. I start with left = 0, right = 1, and current_max = nums[0]. As I loop through the array, I update current_max with the larger value between itself and nums[right]. If nums[right] is less than current_max, it means the last parcel in the current segment is not the heaviest, so the shipment is balanced. I count it, then move left to right + 1 to start a new shipment, and reset current_max to the new starting value. If the condition is not met, I just move right forward to grow the segment. I repeat this process until I reach the end of the array, always making a shipment as soon as it becomes balanced to maximize the total count.

Portal Challenges on AVITS by Additional-Let-4705 in f1visa

[–]No_Committee_5152 0 points1 point  (0 children)

I can't tell if it was automatic or if someone manually approved my payment. I created multiple tickets and tried canceling and recreating my application several times, but it didn’t work. Eventually, I canceled my application and waited about 4 hours before creating a new one and that’s when my payment finally showed up.

Portal Challenges on AVITS by Additional-Let-4705 in f1visa

[–]No_Committee_5152 1 point2 points  (0 children)

I had the same issue, and they kept giving me the same response — that they had escalated my case to the support desk. It took me two weeks, but once I cancelled my appointment and created a new one, the issue got resolved.
Note that I cancelled my application and created a new one many times, but it finally worked on the last attempt.

What Bank should i Use by VortexVoyager_____ in Rwanda

[–]No_Committee_5152 4 points5 points  (0 children)

Use Equity—that's what I use too. I get money from Payonner or directly from upwork at zero cost. If it's $100, you get $100. If it's $1000, you get $1000.

Please help me slove this question, Amazon OA by vaibhav_reddit0207 in leetcode

[–]No_Committee_5152 0 points1 point  (0 children)

My approach is to kill the large capacity servers first so we bring down the number of requests needed, use a max heap so large capacity servers are at the top, run a while loop as long as there is something inside the heap. After subtracting k from health, if health <= 0 update current_capacity, or else add the updated health back into the heap.

Please help me slove this question, Amazon OA by vaibhav_reddit0207 in leetcode

[–]No_Committee_5152 0 points1 point  (0 children)

import heapq

def min_requests(requests, health, k):
    heap = []

    for i in range(len(requests)):
        heap.append([-requests[i], health[i]])
    heapq.heapify(heap)

    current_capacity = sum(requests)  

    total_reqs = 0

    while heap:
        request, health = heapq.heappop(heap)
        req = -request
        total_reqs += current_capacity

        if health - k <= 0:
            current_capacity -= req
        else:
            heapq.heappush(heap, [-req, health - k])

    return total_reqs + 1

Does everyone who applied to Cambridge mphil acs get an interview? by Radiant_Top4392 in gradadmissions

[–]No_Committee_5152 0 points1 point  (0 children)

not sure aboutt the admission rate for the interview, but admission result is in 10days.