Can anybody tell why the above solution is giving TLE??
I am unable to access your code. Please provide my some other link to your code as well as the question.
It redirects me to the interview page. I guess leetcode does not allow sharing of submissions. Either format your code and paste it here along with the question link or ideone it.
variable of loop is same as your variable for horizontal and vertical