I tried to solve some of the problems at interviewstreet.com i found some of the intresting problems there few of them i still remember were k-difference and xor-key problem.
The k-difference problem is the most intresting, according to this problem we have find the combinations of the numbers from the list whose difference equals to k. But the problem does not ends there but a lot other things were there, i.e. Boundary conditions the list is damn large i.e around 1lac nu,bers while the range of numbers in the list were from 0 to 10^5 so computation time the most important factor would be very high if you apply the regula ,ethod of computing the solution.
The average time complexity of your algorithm would be O(n^2). But this algo will not work as the max. Time allocated for the algo is just 3 sec.
But, i have not given up and i have tried but unable to clear all the test cases, but cleared about 10 out of 15...
If you have any idea or solution about this problem then plz. Let me know about it....
I would love to hear abt. It..
The k-difference problem is the most intresting, according to this problem we have find the combinations of the numbers from the list whose difference equals to k. But the problem does not ends there but a lot other things were there, i.e. Boundary conditions the list is damn large i.e around 1lac nu,bers while the range of numbers in the list were from 0 to 10^5 so computation time the most important factor would be very high if you apply the regula ,ethod of computing the solution.
The average time complexity of your algorithm would be O(n^2). But this algo will not work as the max. Time allocated for the algo is just 3 sec.
But, i have not given up and i have tried but unable to clear all the test cases, but cleared about 10 out of 15...
If you have any idea or solution about this problem then plz. Let me know about it....
I would love to hear abt. It..
