Solution to ONP in Python

4.0M, 0.19s