Problem 8 Solution

Surprised I got this one, and fairly elegantly given the provided solns
Problem 9 Solution (Cheat)