这篇小结主要是参考这篇帖子从头到尾彻底理解KMP,不得不佩服原作者,写的真是太详尽了,让博主产生了一种读学术论文的错觉。后来发现原作者是写书的,不由得更加敬佩了。博主不才,尝试着简化一些原帖子的内容,希望能…
分类:LeetCode
[LeetCode] Shortest Palindrome 最短回文串,Palindrome Number 验证回文数字,Validate Palindrome 验证回文字符串,Palindrome Partitioning 拆分回文串,Palindrome Partitioning II 拆分回文串之二,Longest Palindromic Substring 最长回文串
Given a string S, you are allowed to convert it to a palindrome by adding characters in front of it. Fi…
[LeetCode] Max Consecutive Ones 最大连续1的个数
Given a binary array, find the maximum number of consecutive 1s in this array. Example 1: Input: [1,1,0…
leetCode | Next Permutation
题目: Implement next permutation, which rearranges numbers into the lexicographically next greater permutation o…
220. Contains Duplicate III
Given an array of integers, find out whether there are two distinct indices i and j in the array such that the…
40. Combination Sum II
40. Combination Sum II 题目 Given a collection of candidate numbers (C) and a target number (T), find all unique…
[LeetCode] Same Tree 判断相同树
Given two binary trees, write a function to check if they are equal or not. Two binary trees are consid…
[LeetCode] Flip Game 翻转游戏
You are playing the following Flip Game with your friend: Given a string that contains only these two c…
[LeetCode] Delete Node in a BST 删除二叉搜索树中的节点
Given a root node reference of a BST and a key, delete the node with the given key in the BST. Return t…
[Leetcode] Reverse Integer 反转整数
Reverse Integer Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 字符串…
[Leetcode] 002 Add Two Numbers
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order a…
Swift LeetCode 系列之9: palindrome-number
https://leetcode.com/problems/palindrome-number/description/ palindrome-number: 回文数 , 简单理解就是对称数 解决: 每次取到第一个数和最…