Sponsored
Use these hints if you're stuck. Try solving on your own first.
Students in row i only can see exams in row i+1.
Use Dynamic programming to compute the result given a (current row, bitmask people seated in previous row).
Solve with full IDE support and test cases