摘要: 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],... 阅读全文
posted @ 2018-09-22 10:58 vercont 阅读(147) 评论(0) 推荐(0)
摘要: 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],... 阅读全文
posted @ 2018-09-22 10:58 vercont 阅读(106) 评论(0) 推荐(0)
摘要: Given an index k, return the k th row of the Pascal's triangle.For example, given k = 3, Return[1,3,3,1].Note: Could you optimize your... 阅读全文
posted @ 2018-09-22 10:58 vercont 阅读(109) 评论(0) 推荐(0)
摘要: Given an index k, return the k th row of the Pascal's triangle.For example, given k = 3, Return[1,3,3,1].Note: Could you optimize your... 阅读全文
posted @ 2018-09-22 10:58 vercont 阅读(86) 评论(0) 推荐(0)
摘要: Given a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome partitioning o... 阅读全文
posted @ 2018-09-22 10:58 vercont 阅读(101) 评论(0) 推荐(0)
摘要: Given a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome partitioning o... 阅读全文
posted @ 2018-09-22 10:58 vercont 阅读(110) 评论(0) 推荐(0)
摘要: Given a string s, partition s such that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindro... 阅读全文
posted @ 2018-09-22 10:58 vercont 阅读(91) 评论(0) 推荐(0)
摘要: Given a string s, partition s such that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindro... 阅读全文
posted @ 2018-09-22 10:58 vercont 阅读(121) 评论(0) 推荐(0)
摘要: Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down t... 阅读全文
posted @ 2018-09-22 10:58 vercont 阅读(74) 评论(0) 推荐(0)
摘要: Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down t... 阅读全文
posted @ 2018-09-22 10:58 vercont 阅读(83) 评论(0) 推荐(0)
摘要: Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.C++/** * Definition for a point. * ... 阅读全文
posted @ 2018-09-22 10:58 vercont 阅读(135) 评论(0) 推荐(0)
摘要: Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.C++/** * Definition for a point. * ... 阅读全文
posted @ 2018-09-22 10:58 vercont 阅读(116) 评论(0) 推荐(0)
摘要: Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example, Given[100, 4, 200, 1, 3... 阅读全文
posted @ 2018-09-22 10:58 vercont 阅读(94) 评论(0) 推荐(0)
摘要: Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example, Given[100, 4, 200, 1, 3... 阅读全文
posted @ 2018-09-22 10:58 vercont 阅读(110) 评论(0) 推荐(0)
摘要: Given a linked list, determine if it has a cycle in it.Follow up: Can you solve it without using extra space?C++/** * Definition for s... 阅读全文
posted @ 2018-09-22 10:58 vercont 阅读(80) 评论(0) 推荐(0)
摘要: Given a linked list, determine if it has a cycle in it.Follow up: Can you solve it without using extra space?C++/** * Definition for s... 阅读全文
posted @ 2018-09-22 10:58 vercont 阅读(145) 评论(0) 推荐(0)
摘要: Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up: Can you solve it without usin... 阅读全文
posted @ 2018-09-22 10:57 vercont 阅读(117) 评论(0) 推荐(0)
摘要: Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up: Can you solve it without usin... 阅读全文
posted @ 2018-09-22 10:57 vercont 阅读(79) 评论(0) 推荐(0)
摘要: Sort a linked list using insertion sort.C++/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode ... 阅读全文
posted @ 2018-09-22 10:57 vercont 阅读(162) 评论(0) 推荐(0)