Hey thanks for the reply,
I do not want you guys to write the code for me, i just want suggestions on where to comply with the code. Ideas which i have tried
Modifying the loop for 2 D by having a loop within a loop
Checking the input with and additional index in the array
Trying out...