Ad
  • Custom User Avatar

    Yes! It took me about 3 hours of observation to see the pattern.
    P.S. Hint, maybe. Not a spoiler.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    "RESET" the page.

  • Default User Avatar

    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'.