sir iam getting one test case failure ,how i can correct the code
sir is this is the way to solve this problem
if yes then why this question in searching and sorting section
if no then how can we solve this question using searching and sorting
sir iam getting one test case failure ,how i can correct the code
sir is this is the way to solve this problem
if yes then why this question in searching and sorting section
if no then how can we solve this question using searching and sorting
Hello @pankajsingh,
The approach you have used is logically correct but it will fail for large values.
Try to solve this problem using binary search as it is a part of searching and sorting section.
Try to think of an approach.
Let me know if you face any difficulty.
now i set z=100005 then i am getting no output for 2 cases rest are running correct
how i will get output for 5000000 upper limit of n
Hey @pankajsingh,
As I have specified before use the binary search to solve this problem.
You code is not producing output as it is facing TLE.
Refer to the following code for better understanding:
Hope, this would help.