I have solved the problem using this code: https://pastebin.com/btAZcJnh
How to solve class assignment problem
hi prajwal
your code is giving TLE so you are supposed to optimize it and the optimization to the above problem can be done through dp
try doing through dp. if you still don’t get it message me
But I havent reached the dp lecture yet. So I guess I’ll move on for now.