How to optimise my solution?
algorithm
Solution
It looks like a variant of the well known Knapsack Problem
Problem
I recently encountered a problem which goes like this : A student is given N number of questions and T time in total. Each question requires different time to complete and carries different marks. The problem asks to find the maximum marks the student can get by attempting some of the N questions within T time (Assuming if a question is attempted, it must be fully completed,no partial attempt of a question is allowed). I tried to solve the problem by computing all possible combinations of questions which takes <= T seconds to complete but soon found out its ineffective for large datasets. How can I optimise my solution? Is there any alternative solution available?