-
Notifications
You must be signed in to change notification settings - Fork 2
anotherbrick
bradendubois edited this page Nov 8, 2021
·
7 revisions
ID: anotherbrick
Difficulty: 2.1
CPU Time: 1 second
Memory: 1024 MB
Keep two tallies, one for the number of layers complete, and one for the horizontal distance of the current layer completed. Iterating through the bricks, add the width of the brick to the horizontal distance; if the distance == w, reset distance to 0, and increment the number of layers complete. If the number of layers complete is equal to h, then output "YES". Otherwise, output "NO".