← All problemsSign in

Herbs Farming

Geralt is an expert alchemist but always finds it difficult to find the right herbs. So he started his own farm of herbs, where he would grow his own herbs. Right now, he has $N$ different herbs in a row on his farm. He was getting bored, so he came up with a challenging problem for you: You are allowed to divide the $N$ herbs into non-empty groups by creating some partitions (possibly zero) be

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