Maximum Direction in a Matrix

Please format your code properly before posting.
You can use this as a reference.
And it will be better if you explain your code also,
I can’t understand it.
So, edit your Post.

re: I don’t see you using the array module anywhere in your code. So, why are you importing this actually?