easySimulationString 0 views

Reverse Degree of a String

Given a string s, calculate its reverse degree.

Given a string s, calculate its reverse degree.

The reverse degree is calculated as follows:

Return the reverse degree of s.

Reverse Degree of a String diagram

Example 1

Input: s = "abc"

Output: 148

Explanation: The reversed degree is 26 + 50 + 72 = 148 .

Example 2

Input: s = "zaza"

Output: 160

Explanation: The reverse degree is 1 + 52 + 3 + 10^4 = 160 .

Constraints

  • 1 <= s.length <= 1000
  • s contains only lowercase English letters.

Hints

Companies

No companies reported yet.

Discussion

Sign in to join the discussion.

Loading discussion...

Test results

No test cases yet.