The astronomical clock in Prague has a bell that rings 1, 2, 3, or 4 times. The number of strokes follows the sequence 1234321234321…, and for the nth hour, the total number of strokes is n. So, during a day, the patterns are 1, 2, 3, 4, 32, 123, 43, 2123, 432, 1234, 32123, 43212, 34321, 23432, 123432, 1234321, 2343212, 3432123, 4321234, 32123432, 123432123, 43212343, 2123432123, and 432123432.
Write a function to produce the pattern for a given number of hours. Assume that the rules hold for hours beyond 24.
Photo linked from amazingczechia.com

Solution Stats

6 Solutions

5 Solvers

Last Solution submitted on Jan 30, 2025

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...