ques: https://www.interviewbit.com/problems/repeat-and-missing-number-array/
soln: https://ide.codingblocks.com/s/291666
my solution is correct, still, it is partially accepted… they are asking for an optimized solution,
How to optimize further?
ques: https://www.interviewbit.com/problems/repeat-and-missing-number-array/
soln: https://ide.codingblocks.com/s/291666
my solution is correct, still, it is partially accepted… they are asking for an optimized solution,
How to optimize further?
@chaman9 refer this
contain all the methods
(https://www.geeksforgeeks.org/find-a-repeating-and-a-missing-number/)
yeaah that i can see… i too followed one of those methods
can you please tell whats wrong with mine approach as i am doing in O(N) time and space
see the link for a method which dont consume extra space there are 2 3
okay i will see those methods as well…
i have tried using floyd cycle detection algorithm to find the duplicate and then find the missing integer in O(1) space
can you see where i am wrong?