Back
Close

Raindrops

Statement

 Goal

Raindrops are falling from the sky! Each raindrop (|) falls downward until it hits an overhang (row of =) or the ground at the bottom (a full row of _). How many individual raindrops hit the ground?
Input
Line 1: Integers W and H for the width and height of the frame, respectively.
Next H lines: W characters each of either space, |, =, or _.
Output
Line 1: An integer, the count of how many individual raindrops hit the ground.
Constraints
1 ≤ W ≤ 100
2 ≤ H ≤ 100
Example
Input
3 4
  |
| =
 | 
___
Output
2

Game modes
Fastest, Shortest

Test cases
A drizzle Test
Input
3 4 | | = | ___
Output
2

Validator 1 Validator
Input
3 4 | = | ___
Output
2

It's raining Test
Input
6 7 | | || === | ______
Output
3

Validator 2 Validator
Input
6 7 | | || ==== | ______
Output
3

Get an umbrella Test
Input
10 10 || | | | | ==== || || ==== | | __________
Output
6

Validator 3 Validator
Input
10 10 || | | | | === || || ==== | | __________
Output
7

It's pouring Test
Input
80 40 | | | | | | | | || | | | | | | | || ||| | | || | | | | | | | || | | | | | | | || | | | | | ================== || | | | | | || | | | | || | | | || | | ||| | | | | | | | | | ======================== | | | | | | | | | | | | | || | | || | | || || | =============================== | | || | | | || | | | || ||| || | | | | | | | | | | | | | || | | | | | | | | | | | | | | || | | | | | | | | | | | | || | | | || | | || | | | | | || | | | | | | | | | | ============= | | | | | | | | | || | | | | | | | |||| | || | | || | | | | | | | | | | | | | | || | | | | | || | | || | | | | | | | | | || ||| | | ============= | | | | | | | | | | | | | | | | | || | | || | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | || | | || | | | | | | || | | | | | | | | || | ============================= | | || | || | | | | | || | | | | | | | | ========================================== | | | | ________________________________________________________________________________
Output
33

Validator 4 Validator
Input
80 40 | | | | | | | | || | | | | | | | || ||| | | || | | | | | | | || | | | | | | | || | | | | | ================== || | | | | | || | | | | || | | | || | | ||| | | | | | | | | | ======================== | | | | | | | | | | | | | || | | || | | || || | =============================== | | || | | | || | | | || ||| || | | | | | | | | | | | | | || | | | | | | | | | | | | | | || | | | | | | | | | | | | || | | | || | | || | | | | | || | | | | | | | | | | ============= | | | | | | | | | || | | | | | | | |||| | || | | || | | | | | | | | | | | | |================================== | || | | || | | | | | | | | | || ||| | | ============= | | | | | | | | | | | | | | | | | || | | || | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | || | | || | | | | | | || | | | | | | | | || | ============================= | | || | || | | | | | || | | | | | | | | ==================== | | | | ________________________________________________________________________________
Output
88

Solution language

Solution

Stub generator input