Can you please explain how did you take the upper bound as 64*1e15?
@harishankarkarthik35709 ай бұрын
I think the bruteforce solution has O(ulog(u)) time complexity, because binary representation is log(u) length.
@codingmohan9 ай бұрын
We are also iterating over every numbers from 1 to X right.
@hemanthijjurouthu36779 ай бұрын
Awesome explanation sir
@ECBvamsi9 ай бұрын
Sir can you tell why the below code is not working i think this time complexity is lesser then your code if not give me any suggestions to modify the code int count=0; int ans=1; while(count
@codingmohan9 ай бұрын
Can you help understand the intuition of your solution - "Why you think the solution should work?". Also, in this kind of situations, the best thing is to run your code on a simple test case (maybe 8 bit number) and figure out a case where your code is giving incorrect result (you can compare it with any working solution). That way you can better understand if there is a flaw in the logic or your implementation itself. Further if there is a logical flaw, it will help you understand what you actually missed and you'll be able to retain that for a longer duration.
@ECBvamsi9 ай бұрын
@@codingmohan SIR LIKE I WAS COUNTING BITS UPTO LIMIT OF COUNT