question : to find the row or column having maximum sum in a 2 D array
what is wrong with my code?
also ,pls tell a better approach
2 D array question
Hi @chahatkumar
Your array initialisation is wrong . It should be a[row][col] instead of a[i][j] .
After that, you have made a little mistake in Line no 40. I believe you can figure out what.
The rest of your code is fine .
As for the approach , this approach is just fine. You cannot do this question in better than O(n^2). This is the simplest and appropriate approach.
1 Like
okay thanks