Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
doesnt work for me :/
Amazing solution, I didn't think of simply replacing the unsorted odd values with the sorted ones.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
@MuaazK - that sounds like a good idea. I forked a solution using your suggestion.
If the array's length is 10,000,000 and there are only 5 odd numbers in the first 10 positions, the 'for' loop will put them back in their places and continue to scan the array for no reason.
you should check: "s < sortedOdd.length" and break when it is false.
I did the same
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
The bound + 1 / 2 is a nice trick that is useful in many situations where you need the same index for odd and even lengths.
Nice one.
It took me 3 days to solve this one and i came up with 78 lines of code and then i get here and see it solved in 3 lines :))
Still feeling proud to have solved it :)
Loading more items...