Question: Growth in 2 Dimensions Start with an infinite two dimensional grid filled with zeros, indexed from ( 1 , 1 ) at the bottom left

Growth in 2 Dimensions
Start with an infinite two dimensional grid filled with zeros, indexed from (1,1) at the bottom left corner with coordinates increasing toward the top and right. Given a series of coordinates (r, c where r is the ending row and cis the ending column, add 1 to each element in the range from (1,1) to (r, c) inclusive. Once all coordinates are processed, determine how many cells contain the maximal value in the grid.
Function Description
Complete the function countMax in the editor below
countMax has the following parameter(s): string uplightin): an array of strings made of two space-separated integers, rand c
Return
long: the number of occurrences of the final grid's maximal element Constraints
1sns 100
1s number of rows, number of columns & To
D
Input Format for Custom Testing
Input from stain will be processed as follows and passed to the function.
The first line contains an integer n, the size of the array upRight Each of the next in lines contains a string of two space-separated integers representing coordinates rand for element upRight[]
* Sample Case 0
Sample Input
STOIN
3
Function
upRight[] size=3
234
19
upright [123','37','4
ALL
1
2
3
37
41
Sample Output
2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!