Please feel free to edit this editorial by providing your various approaches to this problem in SOLUTION section. If you are not comfortable in editing markdown,you can mentioned your ideas in answers or comments to this post. I will later revise and mention those in the editorial. PROBLEM LINKDIFFICULTYchallenge PREREQUISITESPROBLEMSOLUTIONSOLUTION CODESasked 19 Apr '17, 19:56

My idea was to first bring all the balls in each row to the corresponding cell of the main diagonal (I mean (1,1),(2,2),...). Now to do this I checked if the sum of the row if >1 and if yes find the first ball any one side and push it so that it hits the other end and goes to the corresponding diagonal cell of the row. Then finally push all balls to the pocket in a single shot. This approach got me around 72 points. Now to improvise this approach what I did was that I traverse each row and for every negative element(<1 and not 0) if the lower or upper cell is free I push it to that cell and then do the same idea of the diagonal cell but this time I do not skip any rows. This approach got me 97.7 points. Link to my solution  solution answered 19 Apr '17, 20:12

My first attempt gained about 98.8%. The idea was:
To improve this result, I tried to put positive balls only in each 4th, 5th, etc column, and negative everywhere else. I thought that then there would be fewer moves to do to finish step 2, and also negative balls may not need to move so much. Also, I wrote a separate procedure for the case of no negative balls, since in that case the solution is straightforward. The best result was about 99.1% for every 5th column. I also tried other orders of moves on steps 2 and 3, and one of my 99.1% solutions has positive balls in each 3rd column, they are pushed down to the bottom row, and then to the bottom right corner and out. I was not able to improve it any further. answered 20 Apr '17, 05:29

Setter and Tester solutions are not working.