-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaroGrid.cpp
47 lines (40 loc) · 1.07 KB
/
TaroGrid.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#line 5 "TaroGrid.cpp"
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
class TaroGrid
{
public:
int getNumber(vector <string> grid)
{
int max = 0;
for (int i = 0; i < grid[0].length(); ++i)
{
int present = 1;
for (int j = 0; j < grid.size()-1; ++j)
{
if(grid[j][i] == grid[j+1][i])
{
present++;
}
else
{
if(present > max)
{
max = present;
}
present = 1;
}
}
if(present > max)
{
max = present;
present = 1;
}
}
return max;
}
};
// Powered by FileEdit
// Powered by TZTester 1.01 [25-Feb-2003]
// Powered by CodeProcessor