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.
OP solved it, closing
Wow, i aim for this level of skill
Hey, thanks gotcha! If i'm not wrong this is an example of recursion.
The point of the for loop is to create the next row of the triangle by comparing every two adjacent characters.
The next row is stored in the variable reduced. In the 4th line two consecutive characters are compared, and if
they are the same, that character is added to reduced. If they are different, both are removed form the string 'RGB',
and the remaining character is added to reduced. Let's say row[i] = 'R' and row[i+1] = 'B'. First, 'RGB'.replace(row[i], '')
will return 'GB'. The second replace method will be called on 'GB'. It will replace 'B' with nothing and return 'G'.
Can somebody explain, what is happening in line number 4 , 'RGB'.replace(row[i], '').replace(row[i+1], '');
I appreciate your sense of humor =)
Nope, 3 was quite concious when he went away, I called him back to be in the description.
Hello!
5 4 2 1 0 <--- indices
is 3 missing?
Rewritten the description, removed verbosity of unnecessary stuffs and added sample tests.
Tests use global variable
i
causing them to fall into infinite loops (see post below).You're overriding global
i
variable.Test suite has a bug and it gets tripped up by a global variable, which your solution happens to use (and modify). Remove global variables from your code (there is one), and all should be OK.
This comment is hidden because it contains spoiler information about the solution
Hello!
Exit Code: 137
STDERR : Max Buffer Size Reached (1.5 MiB).
I'm getting this error inspite of all the test cases being passed. And I'm not printing to the console nothing. Help please?
Thanks!
Loading more items...