随笔分类 -  Leetcode

摘要:Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string. Example 1: Ex 阅读全文
posted @ 2018-10-16 20:03 Veritas_des_Liberty 阅读(146) 评论(0) 推荐(0) 编辑
摘要:Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining. 阅读全文
posted @ 2018-10-16 17:35 Veritas_des_Liberty 阅读(170) 评论(0) 推荐(0) 编辑
摘要:Given an unsorted integer array, find the smallest missing positive integer. Given an unsorted integer array, find the smallest missing positive integ 阅读全文
posted @ 2018-10-16 16:59 Veritas_des_Liberty 阅读(184) 评论(0) 推荐(0) 编辑
摘要:Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numb 阅读全文
posted @ 2018-10-15 22:00 Veritas_des_Liberty 阅读(182) 评论(0) 推荐(0) 编辑
摘要:Given a set of candidate numbers (candidates) (without duplicates) and a target number (target), find all unique combinations in candidates where the 阅读全文
posted @ 2018-10-15 21:30 Veritas_des_Liberty 阅读(190) 评论(0) 推荐(0) 编辑
摘要:The count-and-say sequence is the sequence of integers with the first five terms as following: 1. 1 2. 11 3. 21 4. 1211 5. 111221 1 is read off as "on 阅读全文
posted @ 2018-10-14 17:38 Veritas_des_Liberty 阅读(213) 评论(0) 推荐(0) 编辑
摘要:Write a program to solve a Sudoku puzzle by filling the empty cells. A sudoku solution must satisfy all of the following rules: Each of the digits 1-9 阅读全文
posted @ 2018-10-14 16:47 Veritas_des_Liberty 阅读(195) 评论(0) 推荐(0) 编辑
摘要:Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]). Y 阅读全文
posted @ 2018-10-11 22:28 Veritas_des_Liberty 阅读(192) 评论(0) 推荐(0) 编辑
摘要:Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. Example 1: Exampl 阅读全文
posted @ 2018-10-10 23:18 Veritas_des_Liberty 阅读(185) 评论(0) 推荐(0) 编辑
摘要:You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a conca 阅读全文
posted @ 2018-10-09 23:44 Veritas_des_Liberty 阅读(195) 评论(0) 推荐(0) 编辑
摘要:Given a list of sorted characters letters containing only lowercase letters, and given a target letter target, find the smallest element in the list t 阅读全文
posted @ 2018-10-09 08:35 Veritas_des_Liberty 阅读(162) 评论(0) 推荐(0) 编辑
摘要:Given two integers dividend and divisor, divide two integers without using multiplication, division and mod operator. Return the quotient after dividi 阅读全文
posted @ 2018-10-08 21:57 Veritas_des_Liberty 阅读(182) 评论(0) 推荐(0) 编辑
摘要:Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. k is a positive integer and is less than or equal to 阅读全文
posted @ 2018-10-07 22:39 Veritas_des_Liberty 阅读(198) 评论(0) 推荐(0) 编辑
摘要:Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Example 1: Example 2: Cla 阅读全文
posted @ 2018-10-06 21:38 Veritas_des_Liberty 阅读(177) 评论(0) 推荐(0) 编辑
摘要:Given an array nums and a value val, remove all instances of that value in-place and return the new length. Do not allocate extra space for another ar 阅读全文
posted @ 2018-10-06 21:17 Veritas_des_Liberty 阅读(203) 评论(0) 推荐(0) 编辑
摘要:Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length. Do not allocate extra spa 阅读全文
posted @ 2018-10-06 21:12 Veritas_des_Liberty 阅读(179) 评论(0) 推荐(0) 编辑
摘要:Given a linked list, swap every two adjacent nodes and return its head. Example: Note: Your algorithm should use only constant extra space. You may no 阅读全文
posted @ 2018-10-05 21:52 Veritas_des_Liberty 阅读(172) 评论(0) 推荐(0) 编辑
摘要:Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Example: AC code: Runtime: 56 ms, faster than 26.25 阅读全文
posted @ 2018-10-05 21:07 Veritas_des_Liberty 阅读(117) 评论(0) 推荐(0) 编辑
摘要:Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: A 阅读全文
posted @ 2018-10-04 10:43 Veritas_des_Liberty 阅读(180) 评论(0) 推荐(0) 编辑
摘要: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 two lists. Example: 阅读全文
posted @ 2018-10-04 09:54 Veritas_des_Liberty 阅读(147) 评论(0) 推荐(0) 编辑