Piyush and magical park

my code runs fine in ide . is my logic of the code is correct

use sc.next() in line 16
like so: matrix[i][j]= s.next().charAt(0);
and then debug your code

i’ve coded the logic as per the hint .still im getting wrong answer