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.
A person can give you a work_pass even if it's not required and you'll have to check if it's valid and not expired.
What regex can consistently get countries from string like these:
I solved it without regex (check solution because spoiler)
Thanks for helping us to kill the time. Good, complex and fun.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
python new test frameworks
This comment is hidden because it contains spoiler information about the solution
gj
Perhaps my description of the kata will make more sense:
Description
Amidakuji is a lottery method designed to create random pairs between two sets of the same size.In this kata the elements of the first set are whole numbers from 0 to 6. Your task is to write an
amidakuji
function that returns second set comprised of converse numbers.Input
Your function will receive an array of equal-length strings consisting of 0 and 1 characters; this represents the "ladder" structure. The
1
represent the rungs of the ladder and the0
represent empty space.Take a look at the diagram below:
Row
0
of the ladder is'001001'
string, which means there will be two horizontal bridges at this row; one between the vertical lines 2 and 3 and another between vertical lines 5 and 6. When proceed to move down vertical lines, a transition is made to the adjacent vertical line over the nearest bridge.Output
The diagram above is a visual representation of
ladder
argument of the function.At the top of the diagram the 2 has a third position, in the aftermath of the ladder it got a second position. The yellow highlighted path shows the path taken by the 2 value. Every time it encounters a bridge, it moves to the opposite vertical line.
Your function should return an array of numbers, with each number in its final position.
This kata is challenging enough. Most of 6 kyu kata I could write shorter. I think it can be shorter than I wrote but I gave up to find the shorter one.
Great kata on dynamic programming, keep it up.
Approved
The array size is known and fixed. This runs in O(1).
python new test framework
thanks,mine is O(n^6)
Loading more items...