※ 引述《DJYOSHITAKA (franchouchouISBEST)》之銘言: : 3110. Score of a String 唉我只有easy能秒解了 又想那個了 C#: public int ScoreOfString(string s) { var score = 0; for (int i=1;i<s.Length;i++) { var x = s[i-1] - '0'; var y = s[i] - '0'; score += Math.Abs(y - x) } return score; } -- ※ 發信站: 批踢踢實業坊(ptt-club.com.tw), 來自: 114.136.224.3 (臺灣) ※ 文章網址: https://ptt-club.com.tw/Marginalman/M.1717225479.A.6A0
SecondRun: 大師 06/01 15:06
wu10200512: 大師 06/01 15:09
sustainer123: 大師 06/01 15:17
deatheo: 大師 06/01 15:36