Binary search in Integers have friends pblm.

Revision en1, by vMortex, 2021-08-03 04:02:46

One of the tags for Integers have friends problem is binary search but I am not able to figure out how to apply binary search without using segment tree and sparse table.(since i'm a beginner i actually don't know segment tree and sparse table). I want to do it using only binary search if it's possible. My approach: For a value X check if it's possible that max size of friend group is less than or equal to X, if i'm able to do this in O(n) then it's solved but i don't know how to do this in O(n). Am i missing something is there any other way to do it using binary search?

Tags #doubt, #binary search

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English vMortex 2021-08-03 04:02:46 670 Initial revision (published)