随笔分类 - LeetCode
LeetCode笔记
摘要:LeetCode Notes_#58 Length of Last WordLeetCode Contents题目思路和解答思路解答 题目Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the str...
阅读全文
摘要:LeetCode Notes_#53 Maximum SubarrayLeetCode Contents题目思路和解答思路解答需要注意的点 题目Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and retur...
阅读全文
摘要:LeetCode Notes_#38 Count and SayLeetCode Contents题目思路和解答题意思路解答总结 题目The count-and-say sequence is the sequence of integers with the first five terms as following:1.12.113.214.12115.1112211 is read of...
阅读全文
摘要:LeetCode Notes_#6 Zigzag ConversionLeetCode Contents题目思路和解答思路解答要注意的一些点参考 题目The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display th...
阅读全文
摘要:LeetCode Notes_#5 Longest Palindromic SubstringLeetCode Contents题目思路和解答思路解答 题目Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Examp...
阅读全文
摘要:LeetCode Notes_#3 Longest Substring Without Repeating CharactersLeetCode Contents题目思路和解答思路解答高票解答 题目Given a string, find the length of the longest substring without repeating characters.Example 1:Inp...
阅读全文
摘要:LeetCode Notes_#35 Search Insert PositionLeetCode Contents题目思路和解答思路解答高票答案要注意的点 题目Given a sorted array and a target value, return the index if the target is found. If not, return the index where it w...
阅读全文
摘要:LeetCode Notes_#28 Implement strStr()LeetCode Contents题目思路及解答思路解答需要注意的点 题目Implement strStr().Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.E...
阅读全文
摘要:LeetCode Notes_#27 Remove ElementContents题目思路和解答思路解答 题目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 anot...
阅读全文
摘要:LeetCode Notes_#26 Remove Duplicates from Sorted ArrayLeetCode Contents题目思路及解答思路解答要注意的几点 题目Given a sorted array nums, remove the duplicates in-place such that each element appear only once and retur...
阅读全文
摘要:LeetCode Notes_#21 Merge Two Sorted Lists(剑指Offer#25)LeetCode剑指offer Contents 题目思路和解答思路python解答Java解答 题目 Merge two sorted linked lists and return it a
阅读全文
摘要:LeetCode Notes_#20 Valid ParenthesesLeetCodeContents题目思路和解答思路解答 题目Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.An input strin...
阅读全文
摘要:LeetCode Notes_#14 Longest Common PrefixLeetCodeContentsProblemSolution思路解答高票答案Java ProblemWrite a function to find the longest common prefix string amongst an array of strings.If there is no common...
阅读全文
摘要:牛客21天刷题_day#3牛客 Contents 1.好多鱼题目思路和解答2.表达式求值题目解答 1.好多鱼 题目 牛牛有一个鱼缸。鱼缸里面已经有n条鱼,每条鱼的大小为fishSize[i] (1 ≤ i ≤ n,均为正整数),牛牛现在想把新捕捉的鱼放入鱼缸。鱼缸内存在着大鱼吃小鱼的定律。经过观察,
阅读全文
摘要:牛客21天刷题_day#2牛客 Contents 1.禁忌雷炎题目思路和解答注意range的语法关于python的标准输入输出2.小易喜欢的单词题目思路和解答Python跳出两层循环 1.禁忌雷炎 题目 圆的半径平方为S,求坐标系里在这个圆周上面的整数坐标点有几个 输入 25 3 输出 12 0 思
阅读全文
摘要:牛客21天刷题_day#1牛客Contents1.对称的二叉树(剑指 Offer #28)思路分析对称二叉树的判断条件递归函数解答1:递归(Java)解答1:递归(Python)解答2:非递归(Java)2.下厨房 1.对称的二叉树(剑指 Offer #28)请实现一个函数,用来判断一颗二叉树是不是对称的。注意,如果一个二叉树同此二叉树的镜像是同样的,定义其为对称的。 思路分析 对称二叉树...
阅读全文
摘要:LeetCode Notes_#12 Integer to RomanLeetCode ContentsProblemSolution思路代码 ProblemRoman numerals are represented by seven different symbols: I, V, X, L, C, D and M.Symbol ValueI 1V ...
阅读全文
摘要:LeetCode Notes_#9 Palindrome Number(包含#7 Reverse Integer) LeetCode Contents Problem Solution 1.转换成字符串处理 2.初等运算求反转后的数字 3.其他思路 相关的Python知识 Problem Deter
阅读全文
摘要:LeetCode Notes_#13 Roman to IntegerLeetCode ContentsProblemSolution思路1. 字符串划分2. 字母转化成数字代码记录一下几个开始被我忽视的问题另一个很好的思路 ProblemRoman numerals are represented by seven different symbols: I, V, X, L, C, D an...
阅读全文
摘要:Leetcode Notes_#2 Add Two Numbers LeetCode Contents Problem Solution 相关Python知识 Problem You are given two non-empty linked lists representing two non-
阅读全文

浙公网安备 33010602011771号