I've encountered one problem while coding some solution,
In a 2D char array, if I take it on X-Y axis for ex.
a b c
d e f
g h i
here, a(0,0) b(1,0) c(2,0) d(0,1) and so on..
Now in my problem I need to write a code in which for a I need to add following in the list [b,e,d] Similarly,
for b, [a,d,e,f,c]
for c, [b,e,f]
for d, [a,b,e,h,g] and so on.
Note: All those who are getting added to the list are the surrounding member of that char.
PFB the code,
It is giving me ArrayOutOfBoundException, due to obvious reasons.
Need your inputs to get an efficient solution. Please revert for any clarification or suggestion.