-
Notifications
You must be signed in to change notification settings - Fork 2
tornbygge
bradendubois edited this page Nov 24, 2021
·
8 revisions
ID: tornbygge
Difficulty: 1.7
CPU Time: 1 second
Memory: 1024 MB
For this, keep a tally of towers, and a "current" and "previous" for bricks read in. Read the brick into "current", and if current > previous, increment the number of towers. Update previous to current and repeat. If previous is unset when starting, start t to 1 and always check if previous is some sentinel value (like -1), or set towers to 0 and skip checking if previous is unset.