文章 2023-11-01 来自:开发者社区

Leetcode 516. Longest Palindromic Subsequence

Given a string s, find the longest palindromic subsequence’s length in s. You may assume that the maximum length of s is 1000.  找到一个字符串的最长回文子序列,这里注意回文子串和回文序列的区别。子序列不要求连续,子串(subst...

文章 2023-11-01 来自:开发者社区

Leetcode 3. Longest Substring Without Repeating Characters

Given a string, find the length of the longest substring without repeating characters.原题链接:Longest Substring Without Repeating Characters  此题题意是找出一个不包含相同字母的最长子串,题目给出了两个例子来说明题意,但这...

文章 2023-01-05 来自:开发者社区

LeetCode 424. Longest Repeating Character Replacem

DescriptionGiven a string s that consists of only uppercase English letters, you can perform at most k operations on that string.In one operation, you can choose any character of the string and chang....

LeetCode 424. Longest Repeating Character Replacem
文章 2023-01-05 来自:开发者社区

LeetCode 409. Longest Palindrome

DescriptionGiven a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters.This is case sensitive, for example "Aa...

LeetCode 409. Longest Palindrome
文章 2023-01-05 来自:开发者社区

LeetCode 395. Longest Substring with At Least K

DescriptionFind the length of the longest substring T of a given string (consists of lowercase letters only) such that every character in T appears no less than k times.Example 1:Input: s = "...

LeetCode 395. Longest Substring with At Least K
文章 2023-01-05 来自:开发者社区

LeetCode 388. Longest Absolute File Path

DescriptionSuppose we abstract our file system by a string in the following manner:The string "dir\n\tsubdir1\n\tsubdir2\n\t\tfile.ext" represents:dir subdir1 subdir2 file.ext...

LeetCode 388. Longest Absolute File Path
文章 2023-01-05 来自:开发者社区

LeetCode 329. Longest Increasing Path in a Matrix

DescriptionGiven an integer matrix, find the length of the longest increasing path.From each cell, you can either move to four directions: left, right, up or down. You may NOT move diagonally or move....

LeetCode 329. Longest Increasing Path in a Matrix
文章 2023-01-05 来自:开发者社区

LeetCode 300. Longest Increasing Subsequence

DescriptionGiven an unsorted array of integers, find the length of longest increasing subsequence.Example:Input: [10,9,2,5,3,7,101,18]Output: 4Explanation: The longest increasing subsequence is [2,3,....

LeetCode 300. Longest Increasing Subsequence
文章 2023-01-05 来自:开发者社区

LeetCode 128. Longest Consecutive Sequence

DescriptionGiven an unsorted array of integers, find the length of the longest consecutive elements sequence.Your algorithm should run in O(n) complexity.Example:Input: [100, 4, 200, 1, 3, 2]Output: ....

LeetCode 128. Longest Consecutive Sequence
文章 2022-08-04 来自:开发者社区

LeetCode第三题(Longest Substring Without Repeating Characters)三部曲之三:两次优化

欢迎访问我的GitHub这里分类和汇总了欣宸的全部原创(含配套源码):https://github.com/zq2599/blog_demos本文是《LeetCode第三题(Longest Substring Without Repeating Characters)三部曲》的第三篇,之前的两篇文章列出了思路并写出了Java代码,虽然在LeetCode网站提交通过,但是成绩并不理想,40多毫秒的....

LeetCode第三题(Longest Substring Without Repeating Characters)三部曲之三:两次优化

本页面内关键词为智能算法引擎基于机器学习所生成,如有任何问题,可在页面下方点击"联系我们"与我们沟通。

算法编程

开发者社区在线编程频道官方技术圈。包含算法资源更新,周赛动态,每日一题互动。

+关注