![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
文章平均质量分 55
沐婉清
每一天,都要努力前行~~~~
展开
-
219. Contains Duplicate II 答案
219. Contains Duplicate II5.28号群里的附加题 题目 翻译 思路和解题过程 代码及验证图 快捷键 加粗 Ctrl + B 斜体 Ctrl + I 引用 Ctrl + Q 插入链接 Ctrl + L 插入代码 Ctrl + K 插入图片 Ctrl + G 提升标题 Ctrl + H 有序列表 Ctrl + O 无序列表原创 2017-05-28 13:57:14 · 365 阅读 · 0 评论 -
LeetCode解析-7. Reverse Integer
7. Reverse Integer题目描述:Reverse digits of an integer.Example :Example1: x = 123, return 321 Example2: x = -123, return -321Note: The input is assumed to be a 32-bit signed integer. Your function should原创 2017-10-30 19:21:34 · 363 阅读 · 0 评论 -
14. Longest Common Prefix
14. Longest Common Prefix题目描述:Write a function to find the longest common prefix string amongst an array of strings.题目翻译编写一个函数来查找字符串数组中最长的公共前缀字符串。解题方案标签: String思路:定义strs[0]为前缀prefix,将prefix与strs[1]取出相同原创 2017-10-10 21:57:54 · 490 阅读 · 0 评论 -
LeetCode-263. Ugly Number
263. Ugly Number题目描述:Write a program to check whether a given number is an ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 6, 8 are ugly while 14 is原创 2017-10-19 09:35:59 · 309 阅读 · 0 评论 -
202. Happy Number
202. Happy Number题目描述:Write an algorithm to determine if a number is “happy”.A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the s原创 2017-10-18 19:43:40 · 390 阅读 · 0 评论 -
136. Single Number
136. Single Number题目描述:Given an array of integers, every element appears twice except for one. Find that single one.Note: Your algorithm should have a linear runtime complexity. Could you implement it原创 2017-10-18 11:41:33 · 349 阅读 · 0 评论 -
268. Missing Number
题目Given an array containing n distinct numbers taken from 0, 1, 2, …, n, find the one that is missing from the array.For example, Given nums = [0, 1, 3] return 2.Note: Your algorithm should run in li原创 2017-06-03 20:47:20 · 282 阅读 · 0 评论 -
1. Two Sum
示例题目描述:Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use the s原创 2017-09-24 18:04:40 · 428 阅读 · 0 评论 -
217. Contains Duplicate(疑问待解答)
题目Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if every element i原创 2017-06-03 21:07:08 · 301 阅读 · 0 评论 -
119. Pascal's Triangle II
题目Given an index k, return the kth row of the Pascal’s triangle.For example, given k = 3, Return [1,3,3,1].Note: Could you optimize your algorithm to use only O(k) extra space?代码import java.util.Arra原创 2017-06-03 19:47:04 · 394 阅读 · 0 评论 -
118. Pascal's Triangle
题目Given numRows, generate the first numRows of Pascal’s triangle.For example, given numRows = 5, Return [ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1] ]代码import java.util.ArrayLis原创 2017-06-03 19:39:40 · 362 阅读 · 0 评论