← All problemsSign in

Reyna & String

Reyna's exams are over and she wants to play a game so she decides to play Game of Strings. She has a string ***S*** of length ***N*** consisting of upper-case latin alphabets whose **cost C** is defined as : - C = Sum of positions of all the characters of *S* as they appear in **reversed-alphabetical order** **Example** : The cost of the string *"BOB"* is **25+12+25=62**. (*Z* appears at positio

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