← All problemsSign in

Poor Chef

A school runs for $N$ days and each day consists of classes of $M$ different subjects. Fees for the courses change each day ie $A(i, j)$ is the fee for jth subject on ith day. Chef is poor and wants to attend one class each day such that he does not have to attend the same subject for consecutive days and the total cost is minimum. Find the minimum possible total fees chef will pay if he atte

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start