problem 345 and generic solve.py file