Why i'm getting wrong output?
Now it is working . I made some changes. Can you tell me the complexity of my approach ? Is this a good approach or rather i should do with the hint given in the videos?
you are still printing duplicates, so u can fix that still
the complexity looks good to me, but i feel it might fail some cases, have u tried submitting it?
it has passed all the cases
What you mean by duplicates?
1 5 5 3 suppose this is the array and u have to make 8
it will give 3,5 twice while you should get it only once