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.
That makes sense, thanks !
Well, you'll find that the answers can be calculated by dividing n by 2 until it's <= 2. Dividing by 2 constantly is the opposite of multiplying by 2 constantly which is just n^2. Opposite of exponential is logarithm, so log 2.
The rule is called base change rule(since you can change the base, look it up if you're confused about that part). I didn't know I could use
log2()
instead so I went with this.Would you mind explaining the logic behind the logarithmic formula ?
@Radu22 ... Yeah .. Nice Code Bro .. you know that's was my intial Solution to the Kata .. Also You can enhance it by simple devise ...
Set
, Which stores only Unique Values in Sorted Form .O(n)
. Bravo