Tip 1 : Never give up
Tip 2 : When u start a topic, don't move on to next topic before you are 100% confident in previous topic
Tip 3 : Try to give maximum time on basics of a topic especially OOPS
Tip 4 : Practice everyday
Tip 1: Write only those things in resume in which you are 100% confident
Tip 2: Write maximum projects you have and be ready to explain them thoroughly
Tip 3: Don't make any silly spelling mistakes on resume
To do it in minimum time complexity, start from first index, maintain 2 variables of number of of columns and number of rows completely made 1 till now. maintain a variable num=0. Now whenever a 1 is encountered add n -num_column and n-num_row to num and also increment num_row and num_col.
I used inheritance and also used hashmaps to maintain a map of an integer for every department.
Take 1 stone from box1, 2 from box 2 and so on.
Its a straight-forward puzzle available on internet as well.