Garland Machine
CodeChefOpen on judge ↗
Ramesh has a machine which makes a garland with given flowers. Initially Ramesh has to feed the sequence of flowers, and then the machine keeps inserting the flowers in the same order in a string until the "KnoT" button is pressed. Ramesh wants to know the flower at any given nth position and no. of X flower used till nth position. Help him find it. ###Input: - s: a string sequence of flowe
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.
Sign in to chat with the tutor and save your progress.
Sign in to start