标签:tin size turn style for solution shift src class
题目:
解答:
1 class Solution { 2 public: 3 string shiftingLetters(string S, vector<int>& shifts) 4 { 5 int size = (int)S.size(); 6 int cnt = 0; 7 for (int i = size - 1; i >= 0;i--) 8 { 9 cnt += shifts[i] % 26; 10 int index = S[i] - ‘a‘ + cnt; 11 S[i] = (index % 26) + ‘a‘; 12 } 13 return S; 14 } 15 };
标签:tin size turn style for solution shift src class
原文地址:https://www.cnblogs.com/ocpc/p/12826186.html