#3110

Score of a String

newbie · 100 · lc easy +12 · 91.4% accepted · 840 likes · top 100%

Description

Given a string s, compute its score by summing the absolute ASCII-value differences between every pair of adjacent characters. Return the score.

Code

1
2
3