posted by Foobar @ 7:31 PM
Go through the array, everytime u see a number between 1 and k, increment the count in the scratch array indexed by k.After it is done, go through the scratch array and seeing the count for 1, put so many 1's in the given array, replacing its original contents.
Post a Comment
<< Home
Collection of Puzzles.
1 Comments:
Go through the array, everytime u see a number between 1 and k, increment the count in the scratch array indexed by k.
After it is done, go through the scratch array and seeing the count for 1, put so many 1's in the given array, replacing its original contents.
Post a Comment
<< Home