← All problemsSign in

playing with P n C

You are given an integer N. You have to arrange all integers in range($0 \leq i \lt N$) in M arrays such that each array consists of only distinct elements in it and all M arrays have the equal size. But there is one twist. You are also given an integer K and you have to ensure that union of any k or more arrays should result in the complete set of elements ($0 \leq i \lt N$) but union of any numb

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