My code is not giving proper output

https://www.codepile.net/raw/7J1AGjJv.js

why my code is not working.

topic name : $submatrix sum sub Query

your code seems to be correct, can you tell what problem do u facing in it?