Leetcode — 3110. 字符串得分

Leetcode — 3110. 字符串得分

DEV Community DEV Community ·

给定字符串s,其得分为相邻字符ASCII值的绝对差之和。例如,s = 'hello'得分为13,s = 'zaz'得分为50。通过遍历字符串计算得分,时间复杂度为O(n)。

原文英文,约400词,阅读约需2分钟。
阅读原文