← All problemsSign in

Good Strings

Alice likes lowercase letters of the Latin alphabet. She has assigned to each letter a number that shows how much she likes that letter (she has assigned negative numbers to the letters she dislikes). She considers a string lucky for her if the sum of values of all the letters (assigned by her) in the string, except for the first and the last one is equal to zero. Bob considers those strings luc

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