![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
文章平均质量分 58
teminusign
这个作者很懒,什么都没留下…
展开
-
1. Two Sum
1. Two SumLeetcode link for this questionDiscription: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 e原创 2016-07-26 19:33:22 · 209 阅读 · 0 评论 -
19. Remove Nth Node From End of List
19. Remove Nth Node From End of ListDiscription : Given a linked list, remove the nth node from the end of list and return its head.For example,Given linked list: 1->2->3->原创 2016-07-18 10:18:42 · 216 阅读 · 0 评论 -
104. Maximum Depth of Binary Tree
104. Maximum Depth of Binary TreeLeetcode link for this questionDiscription:Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root nod原创 2016-07-18 13:04:45 · 258 阅读 · 0 评论 -
226. Invert Binary Tree
226. Invert Binary TreeLeetcode link for this questionDiscription:Invert a binary tree. 4 / \ 2 7 / \ / \ 1 3 6 9 to 4 / \ 7 2 /原创 2016-07-18 13:07:45 · 175 阅读 · 0 评论 -
237. Delete Node in a Linked List
237. Delete Node in a Linked ListLeetcode link for this questionDiscription:Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.Supposed the link原创 2016-07-18 13:08:37 · 199 阅读 · 0 评论 -
258. Add Digits
258. Add DigitsLeetcode link for this questionDiscription:Given a non-negative integer num, repeatedly add all its digits until the result has only one digit.For example:Given num = 38, the process is原创 2016-07-18 13:08:59 · 250 阅读 · 0 评论 -
283. Move Zeroes
283. Move ZeroesLeetcode link for this questionDiscription:Given an array nums, write a function to move all 0’s to the end of it while maintaining the relative order of the non-zero elements.For examp原创 2016-07-18 13:09:14 · 180 阅读 · 0 评论 -
290. Word Pattern
290. Word PatternLeetcode link for this questionDiscription:Given a pattern and a string str, find if str follows the same pattern.Here follow means a full match, such that there is a bijection between原创 2016-07-18 13:09:27 · 212 阅读 · 0 评论 -
292. Nim Game
292. Nim GameLeetcode link for this questionDiscription:You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3原创 2016-07-18 13:09:52 · 205 阅读 · 0 评论 -
344. Reverse String
344. Reverse StringLeetcode link for this questionDiscription:Write a function that takes a string as input and returns the string reversed.Example: Given s = “hello”, return “olleh”.Analyze:Code 1:cl原创 2016-07-18 13:10:09 · 551 阅读 · 0 评论 -
349. Intersection of Two Arrays
349. Intersection of Two ArraysLeetcode link for this questionDiscription:Given two arrays, write a function to compute their intersection.Example: Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [原创 2016-07-18 13:10:19 · 255 阅读 · 0 评论 -
371. Sum of Two Integers
371. Sum of Two IntegersLeetcode link for this questionDiscription:Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -.Example: Given a = 1 and b = 2, return原创 2016-07-18 13:11:09 · 224 阅读 · 0 评论 -
9. Palindrome Number
9. Palindrome NumberLeetcode link for this questionDiscription:Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints: Could negative integers be p原创 2016-07-19 15:43:18 · 164 阅读 · 0 评论 -
190. Reverse Bits
190. Reverse BitsLeetcode link for this questionDiscription:Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as 00000010100101000001111010011100原创 2016-07-19 15:44:17 · 268 阅读 · 0 评论 -
278. First Bad Version
278. First Bad VersionLeetcode link for this questionDiscription:You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fail原创 2016-07-26 19:43:11 · 276 阅读 · 0 评论 -
234. Palindrome Linked List
234. Palindrome Linked ListLeetcode link for this questionDiscription:Given a singly linked list, determine if it is a palindrome.Follow up: Could you do it in O(n) time and O(1) space?Analyze:#Defini原创 2016-07-26 19:41:58 · 287 阅读 · 0 评论 -
6. ZigZag Conversion
6. ZigZag ConversionLeetcode link for this questionDiscription:The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a原创 2016-07-26 19:33:46 · 199 阅读 · 0 评论 -
7. Reverse Integer
# 7. Reverse Integer[Leetcode link for this question](https://leetcode.com/problems/reverse-integer/)## Discription: Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, r原创 2016-07-26 19:34:02 · 153 阅读 · 0 评论 -
13. Roman to Integer
13. Roman to IntegerLeetcode link for this questionDiscription:Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.Analyze:Code 1:class Solution(ob原创 2016-07-26 19:34:32 · 182 阅读 · 0 评论 -
14. Longest Common Prefix
14. Longest Common PrefixLeetcode link for this questionDiscription:Write a function to find the longest common prefix string amongst an array of strings.Analyze:Code 1:class Solution(object): def原创 2016-07-26 19:34:48 · 149 阅读 · 0 评论 -
20. Valid Parentheses
20. Valid ParenthesesLeetcode link for this questionDiscription:Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must c原创 2016-07-26 19:35:12 · 141 阅读 · 0 评论 -
21. Merge Two Sorted Lists
21. Merge Two Sorted ListsLeetcode link for this questionDiscription:Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first t原创 2016-07-26 19:35:27 · 161 阅读 · 0 评论 -
24. Swap Nodes in Pairs
24. Swap Nodes in PairsLeetcode link for this questionDiscription:Given a linked list, swap every two adjacent nodes and return its head.For example, Given 1->2->3->4, you should return the list as 2-原创 2016-07-26 19:35:57 · 180 阅读 · 0 评论 -
27. Remove Element
27. Remove ElementLeetcode link for this questionDiscription:Given an array and a value, remove all instances of that value in place and return the new length.Do not allocate extra space for another ar原创 2016-07-26 19:36:20 · 155 阅读 · 0 评论 -
26. Remove Duplicates from Sorted Array
26. Remove Duplicates from Sorted ArrayLeetcode link for this questionDiscription:Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.原创 2016-07-26 19:36:37 · 190 阅读 · 0 评论 -
28. Implement strStr()
28. Implement strStr()Leetcode link for this questionDiscription:Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Analyze:Code原创 2016-07-26 19:37:18 · 153 阅读 · 0 评论 -
36. Valid Sudoku
36. Valid SudokuLeetcode link for this questionDiscription:Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells are fil原创 2016-07-26 19:37:56 · 356 阅读 · 0 评论 -
38. Count and Say
38. Count and SayLeetcode link for this questionDiscription:The count-and-say sequence is the sequence of integers beginning as follows: 1, 11, 21, 1211, 111221, … 1 is read off as “one 1” or 11. 11原创 2016-07-26 19:38:23 · 270 阅读 · 0 评论 -
67. Add Binary
67. Add BinaryLeetcode link for this questionDiscription:Given two binary strings, return their sum (also a binary string).For example, a = “11” b = “1” Return “100”.Code 1:class Solution(object):原创 2016-07-26 19:38:56 · 356 阅读 · 0 评论 -
160. Intersection of Two Linked Lists
160. Intersection of Two Linked ListsLeetcode link for this questionDiscription:Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following t原创 2016-07-26 19:40:00 · 313 阅读 · 0 评论 -
13. Roman to Integer
13. Roman to IntegerLeetcode link for this questionDiscription:Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.Analyze:Code 1:class Solution(ob原创 2016-07-19 16:00:45 · 294 阅读 · 0 评论