题目链接:https://leetcode.com/problems/longest-palindromic-substring/ 题目难度:Medium 题目描述: Given a string s, find the…
分类:LeetCode
LeetCode算法题-Best Time to Buy and Sell Stock
这是悦乐书的第172次更新,第174篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第31题(顺位题号是121)。假设有一个数组,其中第i个元素是第i天给定股票的价格。如果只被允许完成最多一笔…
Leetcode - Valid Word Abbreviation
My code: public class Solution { public boolean validWordAbbreviation(String word, String abbr) { int wi = 0; …
[LeetCode] Consecutive Numbers 连续的数字
Write a SQL query to find all numbers that appear at least three times consecutively. +----+-----+ | Id…
LeetCode| Scramble String
题目: Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substring…
[Algo] Find Intersection of Two Sets 找交集
Find Intersection of Two Sets 暴力法 复杂度 时间 O(NM) 空间 O(1) 思路 暴力解法,对于每个在集合1中的元素,我们遍历一遍集合2看看是否存在,如果存在则是Intersection…
[Leetcode] Reverse Words in a String 反转单词顺序
Reverse Words in a String Given an input string, reverse the string word by word. For example, Given s = ̶…
[LeetCode By Go 49]13. Roman to Integer
题目 Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999.…
[LeetCode] Pacific Atlantic Water Flow 太平洋大西洋水流
Given an m x n matrix of non-negative integers representing the height of each unit cell in a continent…
[LeetCode] Find K Closest Elements 寻找K个最近元素
Given a sorted array, two integers k and x, find the k closest elements to&nbs…
力扣(LeetCode)47
题目地址:https://leetcode-cn.com/probl…题目描述:给定一个可包含重复数字的序列,返回所有不重复的全排列。 示例: 输入: [1,1,2]输出:[ [1,1,2], [1,2,1]…
[LintCode][DFS] Word Search
Problem Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from let…