String 类的专题
旋转数组:
1790 · Rotate String II:
这里需要注意的是substring的
- indexstart :inclusive, indexend: exclusive
2.offset need to be modulo
int offset = (left - right) % str.length();
旋转数组:
1790 · Rotate String II:
这里需要注意的是substring的
int offset = (left - right) % str.length();