• Smart solution!

Question related to mission Golden Pyramid

 

I very much appreciated the elegant solution, which didn't require recursion!