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 is super slow...
My friend, we write solutions not tests. The TESTS round answers, not solutions. What are you talking about?
Very complex problem to figure out not only from the description, also the performance requirements are pretty high for being only a 6th kyu.
good
forbidden method
perfect examples of a simple problem solved with something that is really not worth trying to understand
Nice solution but mine better haha :)
clever
this is genius! thank you!
You have two chocolate bars. Each chocolate bar has portraits on it, but not necessarily in the same order. Your goal is to break the second chocolate bar as few times as possible in order to put the portraits in the same order as in the first bar. Each portrait is represented by a number from 1 to n.
For the example given:
first bar
|4|3|2|5|1|
second bar
|1|2|5|3|4|
There are three breaks you have to make in order to assemble the pieces in the correct order. One break between the 1 and 2, one between the 5 and 3, and one between the 3 and 4. That leaves you with the four pieces:
|1| + |2|5| + |3| + |4|
which can be rearranged to match the first bar:
|4| + |3| + |2|5| + |1|
I hope that makes sense.
clean
This comment is hidden because it contains spoiler information about the solution
Really clever and fast solution.
This comment is hidden because it contains spoiler information about the solution
Why use reverse, if we can traverse the array from the end?
Loading more items...