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.
Not best practice. This can be done with time O(n) and space O(n) using a dictionary.
This is very slow since it is using two for loops making it at worst O(n^2).
Because brute force O(n^2) is better practice than a hashed O(n) solution
This comment is hidden because it contains spoiler information about the solution
Length property is not calculated.
This comment is hidden because it contains spoiler information about the solution
No need to cache Length of an array;
too many calculations of numbers.Length. better to assigh it's value to a local variable
Only uses Integer and Boolean.
So it was my intention NOT to use any non-integer calls ;)
If no numbers equal "target", it would raise an exception with "index out of bound" on the inner loop.
Not very durable. Maybe that should of been one of the tests?!
This comment is hidden because it contains spoiler information about the solution
I like this. the j = i + 1 is what I like. Reduces the iterations whilst not requiring an identical index check.
This comment is hidden because it contains spoiler information about the solution
You don't need to test the last number in your first loop. You can stop at "numbers.Lenght-1" since the second loop start at +1.
I would not call buble sort best practice.
Loading more items...