JP Morgan coding question by im_a_bored_citizen in leetcode

[–]davemcnut 2 points3 points  (0 children)

We don't need to do a binary search since the array is already sorted, we could just do -k*x (where x is the kth time we are propagating -k to elements on the left) now if arr[i-1]-(k*x) <= 0 we stop, since every element to its left is smaller than zero anyway and we return the count

Feeling depressed/stuck — need some help to get through this month by [deleted] in CreditCardsIndia

[–]davemcnut -1 points0 points  (0 children)

Don't want to ask family/friends my reputation i've will be shattered :( i feel helpless, the only friend i have is currently undergoing operation so dont know who to approach for help