Count the Mines

tahmidrafi SCB-PA Inter School and C...
Limits 2s, 512 MB

There is a special robot being created by your friend that can detect hidden mines on the ground. But after the robot detects all the mines, it can't count. Why it can't do this simple thing? Because your friend didn't program it to count mines. As you already started learning some programming, you can help your friend to do it. Can you help?

Input

You will be given a 2-D grid of size n X n (1 < n < 100). Each cell will be either e or m.

  • e means empty and
  • m means mine.

Output

You have to print the number of mines in the grid.

Sample

InputOutput
emee
meee
eeee
eeem
3

Submit

Login to submit.

Statistics

87% Solution Ratio
QuickmafsEarliest, Oct '18
QuickmafsFastest, 0.0s
Fazlerabbi.Lightest, 0 B
abdullahalkafiShortest, 55B
Toph uses cookies. By continuing you agree to our Cookie Policy.