You are viewing a single comment's thread. Return to all comments →
I have implemented the same solution in Java and Python 2, and the Python solution times out on some larger cases while the Java solution works. My solution is the same as the editorial. It also seems like no one has submitted a Python solution which gets full score, so it seems like the constraints make it impossible to solve in Python.