乙醚的博客

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

    { 数组 }

  • [LeetCode] 2. Add Two Numbers

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

    题目

    LeetCode链接

    You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list.

    You may assume the two numbers do not contain any leading zero, except the number 0 itself.

    Example

    1
    2
    3
    Input: (2 -> 4 -> 3) + (5 -> 6 -> 4)
    Output: 7 -> 0 -> 8
    Explanation: 342 + 465 = 807.
    Read On »
  • [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