Add a second solution leveraging enumerate() for p22