leetcode算法题
a776995799
这个作者很懒,什么都没留下…
展开
-
leetcode初级算法题-存在重复
题目: 给定一个整数数组,判断是否存在重复元素。 如果任何值在数组中出现至少两次,函数返回 true。如果数组中每个元素都不相同,则返回 false。 示例 1: 输入: [1,2,3,1] 输出: true 示例 2: 输入: [1,2,3,4] 输出: false 示例 3: 输入: [1,1,1,3,3,4,3,2,4,2] 输出: true 解题思路(C): ...原创 2019-02-27 14:28:45 · 221 阅读 · 0 评论 -
leetcode初级算法题-旋转数组
题目: 给定一个数组,将数组中的元素向右移动 k 个位置,其中 k 是非负数。 示例 1: 输入: [1,2,3,4,5,6,7] 和 k = 3 输出: [5,6,7,1,2,3,4] 解释: 向右旋转 1 步: [7,1,2,3,4,5,6] 向右旋转 2 步: [6,7,1,2,3,4,5] 向右旋转 3 步: [5,6,7,1,2,3,4] 示例 2: 输入: [-1,-1...原创 2019-02-24 15:42:23 · 328 阅读 · 0 评论 -
leetcode算法题----Longest Palindrome最长回文
题目: 409. Longest Palindrome最长回文 Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters. 给定一个字符串,包含大写和小写字母。从...原创 2019-03-20 16:03:00 · 129 阅读 · 0 评论 -
leetcode算法题----Sqrt(x)
题目:69. Sqrt(x) Easy Implement int sqrt(int x). Compute and return the square root of x, wherexis guaranteed to be a non-negative integer. Since the return typeis an integer, the decimal digits ...原创 2019-03-12 14:13:13 · 188 阅读 · 0 评论