随笔分类 -  leetcode

leetcode 常见题目
摘要:Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. Input: s = "(()"O 阅读全文
posted @ 2020-12-16 19:16 diameter 阅读(95) 评论(0) 推荐(0) 编辑
摘要:Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such an arrangement is not pos 阅读全文
posted @ 2020-12-14 17:23 diameter 阅读(69) 评论(0) 推荐(0) 编辑
摘要:You are given a string s and an array of strings words of the same length. Return all starting indices of substring(s) in s that is a concatenation of 阅读全文
posted @ 2020-12-13 21:15 diameter 阅读(88) 评论(0) 推荐(0) 编辑
摘要:Given two integers dividend and divisor, divide two integers without using multiplication, division, and mod operator. Return the quotient after divid 阅读全文
posted @ 2020-12-11 21:02 diameter 阅读(97) 评论(0) 推荐(0) 编辑
摘要:Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Clarification: What shoul 阅读全文
posted @ 2020-12-11 15:47 diameter 阅读(76) 评论(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 @ 2020-12-10 18:27 diameter 阅读(140) 评论(0) 推荐(0) 编辑
摘要:Given a sorted array nums, remove the duplicates in-place such that each element appears only once and returns the new length. Do not allocate extra s 阅读全文
posted @ 2020-12-09 22:16 diameter 阅读(58) 评论(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 @ 2020-12-09 19:19 diameter 阅读(79) 评论(0) 推荐(0) 编辑
摘要:Given a linked list, swap every two adjacent nodes and return its head. You may not modify the values in the list's nodes. Only nodes itself may be ch 阅读全文
posted @ 2020-12-07 18:40 diameter 阅读(98) 评论(0) 推荐(0) 编辑
摘要:You are given an array of k linked-lists lists, each linked-list is sorted in ascending order. Merge all the linked-lists into one sorted linked-list 阅读全文
posted @ 2020-12-07 17:58 diameter 阅读(96) 评论(0) 推荐(0) 编辑
摘要:Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. Input: n = 3Output: ["((()))","(()())","(())() 阅读全文
posted @ 2020-12-06 11:54 diameter 阅读(97) 评论(0) 推荐(0) 编辑
摘要:Merge two sorted linked lists and return it as a new sorted list. The new list should be made by splicing together the nodes of the first two lists. I 阅读全文
posted @ 2020-12-04 14:51 diameter 阅读(102) 评论(0) 推荐(0) 编辑
摘要:Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: 阅读全文
posted @ 2020-12-04 11:01 diameter 阅读(115) 评论(0) 推荐(0) 编辑
摘要:Given the head of a linked list, remove the nth node from the end of the list and return its head. Follow up: Could you do this in one pass? Input: he 阅读全文
posted @ 2020-12-03 14:38 diameter 阅读(72) 评论(0) 推荐(0) 编辑
摘要:Given an array nums of n integers and an integer target, are there elements a, b, c, and d in nums such that a + b + c+ d = target? Find all unique qu 阅读全文
posted @ 2020-12-03 11:49 diameter 阅读(78) 评论(0) 推荐(0) 编辑
摘要:Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any 阅读全文
posted @ 2020-12-02 13:39 diameter 阅读(175) 评论(0) 推荐(0) 编辑
摘要:Given an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of the thr 阅读全文
posted @ 2020-12-02 10:18 diameter 阅读(87) 评论(0) 推荐(0) 编辑
摘要:Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the s 阅读全文
posted @ 2020-12-01 18:28 diameter 阅读(89) 评论(0) 推荐(0) 编辑
摘要:Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "". Input: 阅读全文
posted @ 2020-11-30 17:09 diameter 阅读(78) 评论(0) 推荐(0) 编辑
摘要:Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. For example, 2 is written as II in Roman numeral, just two one's ad 阅读全文
posted @ 2020-11-30 15:27 diameter 阅读(94) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示