Tap here to switch tabs
Problem
Submissions

Problem: Reverse Degree of a String

med
30 min
Try to solve the Reverse Degree of a String problem.

Statement

Given a string s consisting of lowercase English letters, calculate the reverse degree of the string.

The reverse degree is the sum of the products calculated for each character in s. For each character, multiply:

  1. Its 11 based position in the reversed English alphabet, where 'z' is 11, 'y' is 22, and 'a' is 2626.

  2. Its 11 based index in s.

Return the total reverse degree of s.

Constraints:

  • 1≤1 \leq s.length ≤1000\leq 1000

  • s contains only lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Reverse Degree of a String

med
30 min
Try to solve the Reverse Degree of a String problem.

Statement

Given a string s consisting of lowercase English letters, calculate the reverse degree of the string.

The reverse degree is the sum of the products calculated for each character in s. For each character, multiply:

  1. Its 11 based position in the reversed English alphabet, where 'z' is 11, 'y' is 22, and 'a' is 2626.

  2. Its 11 based index in s.

Return the total reverse degree of s.

Constraints:

  • 1≤1 \leq s.length ≤1000\leq 1000

  • s contains only lowercase English letters.