← All problemsSign in

Chef and Candy Sticks

Chef loved making candy sticks. Each candy stick is made of a sequence of candies of different flavours. Candy stick can be represented by a ternary string. Hence, '01012' would represent a candy stick. Chef defines the beauty of two candy sticks of same length to be the number of characters which are matching in them at corresponding positions. For example: '01201' and '02210' have a beauty of 2

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