Moving upwards in table from bottom right to calculate the total time taken to read the topics which can be done in given time and have highest weightage sum
i = no_of_topics - 1 ; j = total_time - 1 ; NEW_LINE sum = 0 ; NEW_LINE while ( i > 0 and j > 0 ) : NEW_LINE