Triangle Quest 2

  • + 0 comments

    New non-mathematical solution in Python using string-like operations and Java-like curly braces.

    I'm biased, but I think this is very hacky.

    import io, sys; print(12345678987654321, file=(b := io.StringIO())); s = b.getvalue()
    {sys.stdout.write(s[:i + 1] + s[17 - i:]) for i in range(int(input()))} #enableJavaCurlyBraces=True