Expand the pond getting Run error in some test cases

Please tell me what’s wrong with my code. I am getting Run errors in 4 test cases out of 6 and the remaining 2 are getting passed. I have used DSU in the implementation.