上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 34 下一页
摘要: 地址:https://leetcode-cn.com/problems/move-zeroes/ <?php /** * Class Solution * 283. 移动零 给定一个数组 nums,编写一个函数将所有 0 移动到数组的末尾,同时保持非零元素的相对顺序。 示例: 输入: [0,1,0, 阅读全文
posted @ 2020-04-13 11:41 花花妹子。 阅读(128) 评论(0) 推荐(0)
摘要: 地址:https://leetcode-cn.com/problems/missing-number/ <?php /** 给定一个包含 0, 1, 2, ..., n 中 n 个数的序列,找出 0 .. n 中没有出现在序列中的那个数。 示例 1: 输入: [3,0,1] 输出: 2 示例 2: 阅读全文
posted @ 2020-04-13 11:25 花花妹子。 阅读(123) 评论(0) 推荐(0)
摘要: 地址:https://leetcode-cn.com/problems/ugly-number/ <?php /** 编写一个程序判断给定的数是否为丑数。 丑数就是只包含质因数 2, 3, 5 的正整数。 示例 1: 输入: 6 输出: true 解释: 6 = 2 × 3 示例 2: 输入: 8 阅读全文
posted @ 2020-04-13 10:58 花花妹子。 阅读(140) 评论(0) 推荐(0)
摘要: 地址:https://leetcode-cn.com/problems/add-digits/ <?php /** * 给定一个非负整数 num,反复将各个位上的数字相加,直到结果为一位数。 示例: 输入: 38 输出: 2 解释: 各位相加的过程为:3 + 8 = 11, 1 + 1 = 2。 由 阅读全文
posted @ 2020-04-13 10:42 花花妹子。 阅读(123) 评论(0) 推荐(0)
摘要: 地址:https://leetcode-cn.com/problems/power-of-two/ <?php /** 给定一个整数,编写一个函数来判断它是否是 2 的幂次方。 示例 1: 输入: 1 输出: true 解释: 20 = 1 示例 2: 输入: 16 输出: true 解释: 24 阅读全文
posted @ 2020-04-13 09:56 花花妹子。 阅读(120) 评论(0) 推荐(0)
摘要: 地址:https://leetcode-cn.com/problems/implement-queue-using-stacks/ <?php /** 232. 用栈实现队列 使用栈实现队列的下列操作: push(x) -- 将一个元素放入队列的尾部。 pop() -- 从队列首部移除元素。 pee 阅读全文
posted @ 2020-04-11 16:49 花花妹子。 阅读(187) 评论(0) 推荐(0)
摘要: 地址:https://leetcode-cn.com/problems/single-number/ <?php /** 给定一个非空整数数组,除了某个元素只出现一次以外,其余每个元素均出现两次。找出那个只出现了一次的元素。 说明: 你的算法应该具有线性时间复杂度。 你可以不使用额外空间来实现吗? 阅读全文
posted @ 2020-04-11 16:17 花花妹子。 阅读(104) 评论(0) 推荐(0)
摘要: 地址:https://leetcode-cn.com/problems/min-stack/ <?php /** 设计一个支持 push ,pop ,top 操作,并能在常数时间内检索到最小元素的栈。 push(x) —— 将元素 x 推入栈中。 pop() —— 删除栈顶的元素。 top() —— 阅读全文
posted @ 2020-04-11 16:15 花花妹子。 阅读(139) 评论(0) 推荐(0)
摘要: 地址:https://leetcode-cn.com/problems/merge-sorted-array/ <?php /** 给你两个有序整数数组 nums1 和 nums2,请你将 nums2 合并到 nums1 中,使 nums1 成为一个有序数组。 说明: 初始化 nums1 和 num 阅读全文
posted @ 2020-04-10 18:00 花花妹子。 阅读(135) 评论(0) 推荐(0)
摘要: d地址:https://leetcode-cn.com/problems/implement-strstr/ <?php /** 实现 strStr() 函数。 给定一个 haystack 字符串和一个 needle 字符串,在 haystack 字符串中找出 needle 字符串出现的第一个位置 阅读全文
posted @ 2020-04-09 17:49 花花妹子。 阅读(125) 评论(0) 推荐(0)
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 34 下一页