String 类的专题

旋转数组:
1790 · Rotate String II:
这里需要注意的是substring的

  1. indexstart :inclusive, indexend: exclusive
    2.offset need to be modulo

int offset = (left - right) % str.length();

posted @ 2022-07-17 07:59  奋斗中的菲比  阅读(22)  评论(0编辑  收藏  举报