← All problemsSign in

Sheldon & Books

Sheldon loves books. He has N books and K shelves. Now from the available books he takes 1 book and puts in the first shelf. Next he takes 2 books from remaining books and puts it into second shelf. Next he takes 3 books and puts them into 3rd shelf and so on. Now suppose he is at the kth self, putting k books, he moves back to 1st shelf putting k+1 books in to. Now he continues this until all n b

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