Reverse Degree of a String - Practice Coding | SlaveCode
Problems
Scratchpad
Run
Submit
0
0
1
2
3
4
5
6
7
8
9
0
0
1
2
3
4
5
6
7
8
9
:
0
0
1
2
3
4
5
6
7
8
9
0
0
1
2
3
4
5
6
7
8
9
Toggle theme (Current: Custom)
Scratchpad
Run
Submit
Description
Hints
Solutions
3498. Reverse Degree of a String
Easy
10 Points
String
Simulation
Given a string s, calculate its reverse degree. The reverse degree is calculated as follows: Return the reverse degree of s.
Examples
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 + 104 = 160 .
Constraints
1 <= s.length <= 1000
s contains only lowercase English letters.
JAVASCRIPT
Code
Tests
Result
Description
Hints
Solutions
3498. Reverse Degree of a String
Easy
10 Points
String
Simulation
Given a string s, calculate its reverse degree. The reverse degree is calculated as follows: Return the reverse degree of s.
Examples
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 + 104 = 160 .
Constraints
1 <= s.length <= 1000
s contains only lowercase English letters.
JAVASCRIPT
Code
Tests
Result