
LeetCode
小花魁
这个作者很懒,什么都没留下…
展开
-
Given parentheses
题目描述Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.(给出n对小括号,写一个函数来生成所有的合理的小括号组合)For example, given n = 3, a solution set is:(例如,给出参数:3,结果如下:...原创 2019-03-30 12:16:35 · 228 阅读 · 0 评论 -
Median of Two Sorted Arrays
题目描述There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).You may assume nums1 and ...原创 2019-04-06 12:32:10 · 120 阅读 · 0 评论 -
Divide Two Integers
题目描述Given two integers dividend and divisor, divide two integers without using multiplication, division and mod operator.Return the quotient after dividing dividend by ...原创 2019-04-06 21:04:47 · 114 阅读 · 0 评论 -
Longest Palindromic Substring
题目描述Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.(给一个字符串s,找到字符串s中的最常回文字符串,可以假设s最常为1000个字符)Example 1:Input:...原创 2019-04-01 14:34:59 · 102 阅读 · 0 评论 -
Swap Nodes in Pairs
题目描述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 changed. (给出一个链表,交换每两个相邻的节点...原创 2019-04-07 22:48:33 · 104 阅读 · 0 评论 -
Multiply Strings
题目描述Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string.(给两个非负数字符串——num1和num2,返...原创 2019-04-09 22:21:10 · 174 阅读 · 0 评论 -
Trapping Rain Water
题目描述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.(给出n个非负整数代表一个海拔图,每一个柱形的宽度为1,计算在下雨之后可以存储多少水)...原创 2019-04-14 21:18:15 · 128 阅读 · 0 评论 -
Leetcode 5182. 删除一次得到子数组最大和
今天参加了LeetCode第153场周赛,其中第三题和一道经典题目——连续子数组的最大和很像。我们这道题目的解法和之前这道经典题目的思路有些关系,连续子数组的最大和的解法见链接题目描述给你一个整数数组,返回它的某个 非空 子数组(连续元素)在执行一次可选的删除操作后,所能得到的最大元素总和。换句话说,你可以从原数组中选出一个子数组,并可以决定要不要从中删除一个元素(只能删一次哦),(删除后...原创 2019-09-08 22:43:53 · 751 阅读 · 0 评论