| CodeRams Practice Problem Archive |
|---|
| Finished |
You find yourself stuck in a labyrinth and don't know your way out! There are several dangerous traps placed throughout the labyrinth. You need to find a way out, but first you need to know how many traps there are in the labyrinth.
You will be 2D grid with dimensions n by m. x denotes a trap, and . denotes no trap. The first line of input will contain two space-separated integers n and m, representing the dimensions of the grid. The next n lines will each contain m characters representing a row of the labyrinth.
Output a single integer t: the total number of traps in the labyrinth.
4 5 x.... .x.x. x..x. x.xx.
8
Hint: use a 2D array!
| Name |
|---|


