![Cricket program in java](https://kumkoniak.com/38.jpg)
- Then take array of integers representing height of each element.
-
Initially take input from user which represents number of buildings.The number of buildings in front of it that have a height smaller than or equal to 3 is 2 which is greater than K=1.Bob can not see cricket match from this building.The number of buildings in front of it that has a height smaller than or equal to 1 is also 0 (zero) which is less than K=2,But since there exists a building with height 2 in front of it.
Here, Bob can see the cricket match from this building.The number of buildings in front of it that have a height smaller than or equal to 2 is 0 which is less than K=1.An array A of N integers denoting the heights of each buildingÄetermine the total number of buildings from which Bob can see the cricket match.