Tap here to switch tabs
Problem
Submissions

Problem: Score of a String

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

Statement

You are given a string s. The score of a string is defined as the sum of the absolute differences between the ASCII values of adjacent characters.

Return the score of s.

Constraints:

  • 2≤2 \leq s.length ≤100\leq 100

  • s consists only of lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Score of a String

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

Statement

You are given a string s. The score of a string is defined as the sum of the absolute differences between the ASCII values of adjacent characters.

Return the score of s.

Constraints:

  • 2≤2 \leq s.length ≤100\leq 100

  • s consists only of lowercase English letters.