乙醚的博客

有趣是给别人的,快乐是给自己的。
  • 首页
  • 所有文章
  • 分类查看

    { 数论 }

  • [LeetCode] 189. Rotate Array

    2018-07-02 |
    • { Python }
    • { 解题报告 }
    • { LeetCode }
    • { 数组 }
    • { 模拟 }
    • { 数论 }
    /
    • { 解题报告 }

    题目

    LeetCode链接

    Given an array, rotate the array to the right by k steps, where k is non-negative.

    Example 1:

    1
    2
    3
    4
    5
    6
    Input: [1,2,3,4,5,6,7] and k = 3
    Output: [5,6,7,1,2,3,4]
    Explanation:
    rotate 1 steps to the right: [7,1,2,3,4,5,6]
    rotate 2 steps to the right: [6,7,1,2,3,4,5]
    rotate 3 steps to the right: [5,6,7,1,2,3,4]
    Read On »
© 2025 - 乙醚
Powered by Hexo , Theme - Icalm