Question: Please solve with JAVA code. You are given an n*m grid which contains lower case English letters. How many times does the phrase agu appear
Please solve with JAVA code.

You are given an n*m grid which contains lower case English letters. How many times does the phrase "agu" appear horizontally, vertically, and diagonally in the grid? The phrase "agu" must be in one of these shapes: a a a Do u u 8 09 a 8 u u a Input Format First line will include two integer numbers (n and m), where n denotes the number of rows and m denotes the number of columns in the grid. Next n lines will contain a string of length m which contains lower-case English letters only Constraints 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
