Skip to content

Commit f59e286

Browse files
committed
For loop practice
Signed-off-by: Someshdiwan <[email protected]>
1 parent 1052245 commit f59e286

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
public class CountingError
2+
{
3+
public static int count(String[][] things)
4+
{
5+
int count = 0;
6+
for (int r = 0; r < things.length; r++)
7+
{
8+
for (int c = 0; c < things[r].length - 1; c++)
9+
{
10+
if (things[r][c].indexOf("a") >= 0)
11+
{
12+
count++;
13+
}
14+
}
15+
}
16+
return count;
17+
}
18+
}

0 commit comments

Comments
 (0)