← All problemsSign in

String Power

ALICE and BOB are playing a game with strings. Both of them have a string of length N consisting of lower case characters only. A permutation of “abcdefghijklmnopqrstuvwxyz” is given in the input that defines the POWER of the characters (a-z). The position of the character starting from the left defines the POWER of a character. The position of the leftmost character is taken to be 0. If a chara

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