Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

Count the Mines

By tahmidrafi · 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


    Discussion
    Statistics

    82% Solution Ratio

    QuickmafsEarliest, Oct '18

    QuickmafsFastest, 0.0s

    Fazlerabbi.Lightest, 0 B

    touhidurShortest, 62B

    Submit

    Login to submit