![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
文章平均质量分 61
寒风中的易水
这个作者很懒,什么都没留下…
展开
-
leetcode:20 Valid Parentheses-每日编程第三十七题
Valid ParenthesesTotal Accepted: 84022 Total Submissions: 301663 Difficulty: EasyGiven a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input s原创 2015-12-26 20:48:19 · 301 阅读 · 0 评论 -
leetcode:9 Palindrome Number-每日编程第二十八题
Palindrome NumberTotal Accepted: 95160 Total Submissions: 317694 Difficulty: EasyDetermine whether an integer is a palindrome. Do this without extra space.思路:1).使用while(x/10>base),而不是while原创 2015-12-15 21:45:21 · 427 阅读 · 0 评论 -
leetcode:257 Binary Tree Paths-每日编程第四十五题
Binary Tree PathsTotal Accepted: 27476 Total Submissions: 108456 Difficulty: EasyGiven a binary tree, return all root-to-leaf paths.For example, given the following binary tree:原创 2015-12-29 14:48:47 · 490 阅读 · 0 评论 -
leetcode:234 Palindrome Linked List-每日编程第四十四题
Palindrome Linked ListTotal Accepted: 31409 Total Submissions: 122659 Difficulty: EasyGiven a singly linked list, determine if it is a palindrome.Follow up:Could you do it in O(n)原创 2015-12-29 13:50:05 · 380 阅读 · 0 评论 -
leetcode:67 Add Binary-每日编程第四十三题
Add BinaryTotal Accepted: 67578 Total Submissions: 261262 Difficulty: EasyGiven two binary strings, return their sum (also a binary string).For example,a = "11"b = "1"Return "1原创 2015-12-29 11:22:31 · 392 阅读 · 0 评论 -
leetcode:14 Longest Common Prefix-每日编程第四十二题
Longest Common PrefixTotal Accepted: 78873 Total Submissions: 295144 Difficulty: EasyWrite a function to find the longest common prefix string amongst an array of strings.class Solut原创 2015-12-29 11:15:26 · 326 阅读 · 0 评论 -
leetcode:203 Remove Linked List Elements-每日编程第四十题
Remove Linked List ElementsTotal Accepted: 44897 Total Submissions: 165785 Difficulty: EasyRemove all elements from a linked list of integers that have value val.ExampleGiven: 1 --原创 2015-12-28 21:46:48 · 300 阅读 · 0 评论 -
leetcode:290 Word Pattern-每日编程第三十九题
Word PatternTotal Accepted: 19405 Total Submissions: 71219 Difficulty: EasyGiven a pattern and a string str, find if str follows the same pattern.Here follow means a full match, such原创 2015-12-28 20:19:28 · 321 阅读 · 0 评论 -
leetcode:205 Isomorphic Strings-每日编程第三十八题
Isomorphic StringsTotal Accepted: 39963 Total Submissions: 145129 Difficulty: EasyGiven two strings s and t, determine if they are isomorphic.Two strings are isomorphic if the charac原创 2015-12-28 19:54:58 · 280 阅读 · 0 评论 -
leetcode:160 Intersection of Two Linked Lists-每日编程第二十九题
Intersection of Two Linked ListsTotal Accepted: 53988 Total Submissions: 181510 Difficulty: EasyWrite a program to find the node at which the intersection of two singly linked lists begi原创 2015-12-15 22:17:55 · 273 阅读 · 0 评论 -
leetcode:225 Implement Stack using Queues-每日编程第二十六题
Binary Tree Level Order TraversalTotal Accepted: 25331 Total Submissions: 83601 Difficulty: EasyImplement the following operations of a stack using queues.push(x) -- Push element原创 2015-12-15 21:01:37 · 425 阅读 · 0 评论 -
leetcode:219 Contains Duplicate II-每日编程第三十五题
Contains Duplicate IITotal Accepted: 38552 Total Submissions: 137098 Difficulty: EasyGiven an array of integers and an integer k, find out whether there are two distinct indices i and j in原创 2015-12-26 19:52:44 · 316 阅读 · 0 评论 -
leetcode:58 Length of Last Word-每日编程第三十四题
Length of Last WordTotal Accepted: 76106 Total Submissions: 269840 Difficulty: EasyGiven a string s consists of upper/lower-case alphabets and empty space characters ' ', return the le原创 2015-12-26 19:35:25 · 290 阅读 · 0 评论 -
leetcode:223 Rectangle Area-每日编程第三十三题
Valid SudokuTotal Accepted: 25744 Total Submissions: 91222 Difficulty: EasyFind the total area covered by two rectilinear rectangles in a 2D plane.Each rectangle is defined by it原创 2015-12-24 16:52:12 · 386 阅读 · 0 评论 -
leetcode:190 Reverse Bits-每日编程第三十二题
Reverse BitsTotal Accepted: 46760 Total Submissions: 160246 Difficulty: EasyReverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary原创 2015-12-24 16:03:58 · 348 阅读 · 0 评论 -
leetcode:88 Merge Sorted Array-每日编程第三十一题
Merge Sorted ArrayTotal Accepted: 80108 Total Submissions: 271926 Difficulty: EasyGiven two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.思路:原创 2015-12-24 15:58:05 · 273 阅读 · 0 评论 -
leetcode:111 Minimum Depth of Binary Tree-每日编程第三十题
Minimum Depth of Binary TreeTotal Accepted: 84968 Total Submissions: 285784 Difficulty: EasyGiven a binary tree, find its minimum depth.The minimum depth is the number of nodes along原创 2015-12-24 15:35:30 · 267 阅读 · 0 评论 -
leetcode:172 Factorial Trailing Zeroes-每日编程第二十四题
Factorial Trailing ZeroesTotal Accepted: 44351 Total Submissions: 144160 Difficulty: EasyGiven an integer n, return the number of trailing zeroes in n!.Note: Your solution should be原创 2015-12-15 20:32:12 · 337 阅读 · 0 评论 -
leetcode:112 Path Sum-每日编程第二十七题
Path SumTotal Accepted: 81534 Total Submissions: 268857 Difficulty: EasyGiven a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values alon原创 2015-12-15 21:14:25 · 274 阅读 · 0 评论 -
leetcode:118 Pascal's Triangle-每日编程第二十四题
Pascal's TriangleTotal Accepted: 66425Total Submissions: 210900Difficulty: EasyGiven numRows, generate the first numRows of Pascal's triangle.For example, given numRows = 5,Return[原创 2015-12-13 21:50:46 · 219 阅读 · 0 评论 -
leetcode:26 Remove Duplicates from Sorted Array-每日编程第二十三题
Remove Duplicates from Sorted ArrayTotal Accepted: 98385 Total Submissions:307605 Difficulty:EasyGiven a sorted array, remove the duplicates in place such that each element appear only原创 2015-12-13 21:32:53 · 362 阅读 · 0 评论 -
leetcode:198 House Robber-每日编程第二十二题
House RobberTotal Accepted: 44999Total Submissions: 140629 Difficulty: EasyYou are a professional robber planning to rob houses along a street. Each house has a certain amount of money sta原创 2015-12-13 10:54:42 · 569 阅读 · 0 评论 -
leetcode:27 Remove Element-每日编程第二十一题
Remove ElementTotal Accepted: 89646 Total Submissions: 276815 Difficulty: EasyGiven an array and a value, remove all instances of that value in place and return the new length.The or原创 2015-12-11 11:52:09 · 302 阅读 · 0 评论 -
leetcode:21 Merge Two Sorted Lists-每日编程第十七题
Merge Two Sorted ListsTotal Accepted: 95133 Total Submissions: 281996 Difficulty: EasyMerge two sorted linked lists and return it as a new list. The new list should be made by splicing togethe原创 2015-12-11 10:14:35 · 240 阅读 · 0 评论 -
leetcode:104 Maximum Depth of Binary Tree-每日编程第三题
Maximum Depth of Binary TreeTotal Accepted: 105659 Total Submissions: 227723 Difficulty: EasyGiven a binary tree, find its maximum depth.The maximum depth is the number of nodes al原创 2015-12-10 14:27:31 · 237 阅读 · 0 评论 -
leetcode:232 Implement Queue using Stacks-每日编程第十六题
Implement Queue using StacksTotal Accepted: 26279 Total Submissions: 77749 Difficulty: EasyImplement the following operations of a queue using stacks.push(x) -- Push element x to the原创 2015-12-11 10:06:12 · 211 阅读 · 0 评论 -
leetcode:191 Number of 1 Bits-每日编程第十三题
Number of 1 BitsTotal Accepted: 63943 Total Submissions: 169155 Difficulty: EasyWrite a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as t原创 2015-12-10 14:40:53 · 254 阅读 · 0 评论 -
leetcode:237 Delete Node in a Linked List-每日编程第四题
Delete Node in a Linked ListTotal Accepted: 47385 Total Submissions: 107608 Difficulty: EasyWrite a function to delete a node (except the tail) in a singly linked list, given only acce原创 2015-12-10 14:28:35 · 325 阅读 · 0 评论 -
leetcode:292 Nim Game-每日编程第一题
Nim GameTotal Accepted: 24894 Total Submissions: 49816 Difficulty: Easy You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time o原创 2015-12-10 14:23:59 · 380 阅读 · 0 评论 -
leetcode:169 Majority Element-每日编程第十一题
Majority ElementTotal Accepted: 78809 Total Submissions: 206122 Difficulty: EasyGiven an array of size n, find the majority element. The majority element is the element that appears mo原创 2015-12-10 14:39:32 · 317 阅读 · 0 评论 -
leetcode:258 Add Digits-每日编程第二题
Add DigitsTotal Accepted: 49005 Total Submissions: 102997 Difficulty: EasyGiven a non-negative integer num, repeatedly add all its digits until the result has only one digit. For e原创 2015-12-10 14:25:45 · 726 阅读 · 0 评论 -
leetcode:171 Excel Sheet Column Number-每日编程第十题
Excel Sheet Column NumberTotal Accepted: 54683 Total Submissions: 140674 Difficulty: Easy Given a column title as appear in an Excel sheet, return its corresponding column number.原创 2015-12-10 14:38:48 · 194 阅读 · 0 评论 -
C++11 学习笔记 模板的细节(右尖括号,using,函数模板默认参数)
一.模板的右尖括号在C++98/03的泛型编程中,模板实例化有一个很繁琐的地方,就是连续两个右尖括号(>>)会被编译解释成右移操作符,而不是模板参数表的形式。即template struct Foo{ typedef T type;};template class A{ // ....};int main(){ Foo>::type xx;/原创 2015-12-10 19:35:53 · 5132 阅读 · 0 评论 -
leetcode:206 Reverse Linked List-每日编程第十四题
Reverse Linked ListTotal Accepted: 65133 Total Submissions: 179691 Difficulty: EasyReverse a singly linked list.Hint:A linked list can be reversed either iteratively or recursive原创 2015-12-10 14:41:28 · 220 阅读 · 0 评论 -
leetcode:217 Contains Duplicate-每日编程第九题
Contains DuplicateTotal Accepted: 54264 Total Submissions: 139273 Difficulty: EasyGiven an array of integers, find if the array contains any duplicates. Your function should return tru原创 2015-12-10 14:37:08 · 197 阅读 · 0 评论 -
leetcode:283 Move Zeroes-每日编程第五题
Move ZeroesTotal Accepted: 36621 Total Submissions: 86626 Difficulty: EasyGiven an array nums, write a function to move all 0's to the end of it while maintaining the relative order of原创 2015-12-10 14:29:46 · 239 阅读 · 0 评论 -
leetcode:242 Valid Anagram-每日编程第八题
Valid AnagramTotal Accepted: 42673 Total Submissions: 109227 Difficulty: EasyGiven two strings s and t, write a function to determine if t is an anagram of s.For example,s = "ana原创 2015-12-10 14:34:10 · 206 阅读 · 0 评论 -
leetcode:226 Invert Binary Tree-每日编程第七题
Invert Binary TreeTotal Accepted: 54353 Total Submissions: 129489 Difficulty: EasyInvert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2原创 2015-12-10 14:31:04 · 234 阅读 · 0 评论 -
leetcode:101 Symmetric Tree-每日编程第二十题
Symmetric TreeTotal Accepted: 83908 Total Submissions: 257485 Difficulty: EasyGiven a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For exampl原创 2015-12-11 11:10:29 · 472 阅读 · 0 评论 -
leetcode:235 Lowest Common Ancestor of a Binary Search Tree-每日编程第十二题
Lowest Common Ancestor of a Binary Search TreeTotal Accepted: 41013 Total Submissions: 108082 Difficulty: Easy Given a binary search tree (BST), find the lowest common ancestor (LC原创 2015-12-10 14:40:09 · 213 阅读 · 0 评论