-
Notifications
You must be signed in to change notification settings - Fork 2
cudoviste
bradendubois edited this page Jun 9, 2021
·
6 revisions
ID: cudoviste
Difficulty: 1.4
CPU Time: 1 second
Memory: 1024 MB
For this, one reads in the entire "lot", and can take every 2x2 square in the lot (A loop from 0 to R-1, inner loop of 0 to C-1, and take the 4 points of lot[r][c], lot[r][c+1], lot[r+1][c], lot[r+1][c+1]) and count how many Xs there are (skipping if any are a #), and increment a map/tally for that number of squished cars. Afterwards, simply iterate through the map/tallies from 0 to 4.