0 like 0 dislike
652 views
| 652 views

## 1 Answer

0 like 0 dislike
Best answer

Best Resources for Binary Search :

https://codeforces.com/blog/entry/67509

https://www.linkedin.com/posts/kumar-k-4ba3351a8_leetcode-binarysearch-activity-6808413725389852672-jiCf

Best Problems :

Good LeetCode Problems :

3)https://leetcode.com/problems/minimum-number-of-days-to-make-m-bouquets/

(partition array into k parts , such that the part with maximum sum is minimized , find that maximum sum )

New Problem : https://codeforces.com/contest/1486/problem/C2

Best Problem : https://atcoder.jp/contests/abc174/tasks/abc174_e

-------------------------------------------------------------------------------------------------------------------------

1)

{Double Binary Search}

(Asking for k’th highest number)

Solution : Sort the ranges w.r.p to start point one time.

Another time w.r.p to end time.

(Descending Order)

Now you want to know how many numbers are greater than equal to 7.

Say ranges are : [100,90] ,[95,67],[30,7],[10,1],[9,2],[5,1]

[Start,End]

End points : [90,67,7,2,1,1]

Sum of all guys with end-points>=7=>x

(Don’t consider those ranges which start and end at 7 now,because they have been considered above already)

All ranges with start points greater than equal to 7 : [100,90] ,[95,67],[30,7],[10,1],[9,2].

And from them, only those guys with end-points smaller than 7(their sum)  : abs(10-1)+1 + abs(9-2)+1 = 18=y.

Answer is x + y .

{Code Not written}

Similar to :

{Double Binary Search}

(Same logic for the kth smallest pair)

(Yes-Code)

------------------------------------------------------------------------------------------------------------------

1)https://www.codechef.com/problems/ALIEN1(Yes Code)

https://codeforces.com/contest/1354/problem/C1(Geometry+Circles)(No-code)

https://codeforces.com/contest/1354/problem/C2(Geometry+Circles)(No-code)

3)https://codingcompetitions.withgoogle.com/codejam/round/000000000019fef2/00000000002d5b63(Based on circles+geometry)(No-code)

Find the longest subarray whose cost is less than “s”.[Binary-Search]

(Cost of a subarray is :----> [i:j]-->[ a[i]+i*k + a[i+1]+(i+1)*k+....],where ‘k’ is length of the subarray)Solution:-https://ideone.com/xcpv66(Yes-code)

6)https://codeforces.com/contest/1295/problem/C(Yes-code)

(No-code)

Required : Longest Subarray with Sum greater than Equal to Zero

{Kadane’s algorithm}(Best method)

https://www.geeksforgeeks.org/largest-subarray-having-sum-greater-than-k/

(No-code)

(No-code)

(Yes-code)

16)https://www.hackerearth.com/challenges/competitive/april-circuits-20/algorithm/people-carrying-6dd467ed/editorial/(Later){Great-Problem){No-code}

by Expert (17,730 points)