Using problem81 as template
Solving, with minimal change
Solving, with minimal change
Cleaning up solution a bit