← All problemsSign in

Chef and his string challenge

One of Chef's old friends recently came up with a challenge for him. The problem is as follows: Chef is given a string p. The string is composed solely of lowercase English letters in any order. Each letter is assigned a value v in alphabetical order, starting from 1. So 'a' has the value 1, 'b' has value 2 and so on till 'z' with the value 26 Given n queries consisting of a single integer mi, y

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