Ad
  • Custom User Avatar

    beautiful solution. Thank you

  • Custom User Avatar

    I am too new to Python to even start understanding a fraction of how this code works. It certainly looks a lot more compact than the code I wrote, but is it also more efficient than code written with explicit for loops and if statements, assuming that this code is in its optimum form?

  • Custom User Avatar

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

  • Custom User Avatar

    Anyone know how to fix this?

    Traceback (most recent call last):
    File "main.py", line 1, in
    from solution import *
    File "/home/codewarrior/solution.py", line 20
    SyntaxError: Non-ASCII character '\xc2' in file /home/codewarrior/solution.py on line 20, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details