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.
Please don't do that, we are not in 1970's C code. Variables should be declared as local as possible. You are not saving up anything and the compiler will optimize it for you anyways.
Clever approach but the time complexity is O(N^2)
You could declare variable c out of for, that variable will created for one times
how do you test for time?
great solution bro
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
i agree. it kind of kills the point of this kata
This comment is hidden because it contains spoiler information about the solution
No, time complexity is still
O(n * (n + n + n)) = O(n²)
.This comment is hidden because it contains spoiler information about the solution
It has to be one or the other, since all the other values are equal to each other.
I run your in 600+ ms and mine in 260 ms.
I test every value until I find the unique where you sort the whole array.
@kjanus-thecreator Description says. "The tests contain some very huge arrays, so think about performance"
I insist this 6 kyu kata's solution should be implemented in imperative style, not two-lines declarative one. Otherwise it must be 7 kyu.
This comment is hidden because it contains spoiler information about the solution
Loading more items...