原文链接: https://leetcode-cn.com/problems/longest-substring-without-repeating-characters 英文原文Given a string s, find the length of the longest substring without repeating characters. Example 1: Input: s = "abcabcbb" Output: 3 Explanation: The answer is "…
标签详情
字符串 分类
原文链接: https://leetcode-cn.com/problems/zigzag-conversion 英文原文The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) P A H N A P L S …
原文链接: https://leetcode-cn.com/problems/string-to-integer-atoi 英文原文Implement the myAtoi(string s) function, which converts a string to a 32-bit signed integer (similar to C/C++'s atoi function). The algorithm for myAtoi(string s) is as follows: Read i…
原文链接: https://leetcode-cn.com/problems/regular-expression-matching 英文原文Given an input string s and a pattern p, implement regular expression matching with support for '.' and '*' where: '.' Matches any single character. '*' Matches zero or more o…
原文链接: https://leetcode-cn.com/problems/integer-to-roman 英文原文Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L 50 C 100 D 500 M 1000 For example, 2 is written as II in Roman numeral, just tw…
原文链接: https://leetcode-cn.com/problems/roman-to-integer 英文原文Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L 50 C 100 D 500 M 1000 For example, 2 is written as II in Roman numeral, just tw…
原文链接: https://leetcode-cn.com/problems/longest-common-prefix 英文原文Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "". Example 1: Input: strs = ["flower","flow"…
原文链接: https://leetcode-cn.com/problems/letter-combinations-of-a-phone-number 英文原文Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any order. A mapping o…
原文链接: https://leetcode-cn.com/problems/valid-parentheses 英文原文Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: Open brackets must be closed by the sam…
原文链接: https://leetcode-cn.com/problems/generate-parentheses 英文原文Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. Example 1: Input: n = 3 Output: ["((()))","(()())","(())()","()(())","()()()"] Exa…
原文链接: https://leetcode-cn.com/problems/implement-strstr 英文原文Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Clarification: What should we return when needle is an empty stri…
原文链接: https://leetcode-cn.com/problems/substring-with-concatenation-of-all-words 英文原文You are given a string s and an array of strings words of the same length. Return all starting indices of substring(s) in s that is a concatenation of each word in w…
原文链接: https://leetcode-cn.com/problems/longest-valid-parentheses 英文原文Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. Example 1: Input: s = "(()" Output: 2 Explanatio…
原文链接: https://leetcode-cn.com/problems/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. Note: You must not use any built-in BigInteger librar…
原文链接: https://leetcode-cn.com/problems/wildcard-matching 英文原文Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for '?' and '*' where: '?' Matches any single character. '*' Matches any sequence of characters…
原文链接: https://leetcode-cn.com/problems/length-of-last-word 英文原文Given a string s consisting of some words separated by some number of spaces, return the length of the last word in the string. A word is a maximal substring consisting of non-space chara…
原文链接: https://leetcode-cn.com/problems/valid-number 英文原文A valid number can be split up into these components (in order): A decimal number or an integer. (Optional) An 'e' or 'E', followed by an integer. A decimal number can be split up into these com…
原文链接: https://leetcode-cn.com/problems/add-binary 英文原文Given two binary strings a and b, return their sum as a binary string. Example 1: Input: a = "11", b = "1" Output: "100" Example 2: Input: a = "1010", b = "1011" Output: "10101" Constraints: 1 <= …
原文链接: https://leetcode-cn.com/problems/text-justification 英文原文Given an array of strings words and a width maxWidth, format the text such that each line has exactly maxWidth characters and is fully (left and right) justified. You should pack your word…
原文链接: https://leetcode-cn.com/problems/simplify-path 英文原文Given a string path, which is an absolute path (starting with a slash '/') to a file or directory in a Unix-style file system, convert it to the simplified canonical path. In a Unix-style file …
原文链接: https://leetcode-cn.com/problems/edit-distance 英文原文Given two strings word1 and word2, return the minimum number of operations required to convert word1 to word2. You have the following three operations permitted on a word: Insert a character De…
原文链接: https://leetcode-cn.com/problems/minimum-window-substring 英文原文Given two strings s and t of lengths m and n respectively, return the minimum window substring of s such that every character in t (including duplicates) is included in the window. I…
原文链接: https://leetcode-cn.com/problems/scramble-string 英文原文We can scramble a string s to get a string t using the following algorithm: If the length of the string is 1, stop. If the length of the string is > 1, do the following: Split the string into…
原文链接: https://leetcode-cn.com/problems/decode-ways 英文原文A message containing letters from A-Z can be encoded into numbers using the following mapping: 'A' -> "1" 'B' -> "2" ... 'Z' -> "26" To decode an encoded message, all the digits must be grouped t…
原文链接: https://leetcode-cn.com/problems/restore-ip-addresses 英文原文A valid IP address consists of exactly four integers separated by single dots. Each integer is between 0 and 255 (inclusive) and cannot have leading zeros. For example, "0.1.2.201" and "…
原文链接: https://leetcode-cn.com/problems/interleaving-string 英文原文Given strings s1, s2, and s3, find whether s3 is formed by an interleaving of s1 and s2. An interleaving of two strings s and t is a configuration where they are divided into non-empty su…
原文链接: https://leetcode-cn.com/problems/distinct-subsequences 英文原文Given two strings s and t, return the number of distinct subsequences of s which equals t. A string's subsequence is a new string formed from the original string by deleting some (can b…
原文链接: https://leetcode-cn.com/problems/word-ladder-ii 英文原文A transformation sequence from word beginWord to word endWord using a dictionary wordList is a sequence of words beginWord -> s1 -> s2 -> ... -> sk such that: Every adjacent pair of words diff…
原文链接: https://leetcode-cn.com/problems/word-ladder 英文原文A transformation sequence from word beginWord to word endWord using a dictionary wordList is a sequence of words beginWord -> s1 -> s2 -> ... -> sk such that: Every adjacent pair of words differs…
原文链接: https://leetcode-cn.com/problems/palindrome-partitioning 英文原文Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. A palindrome string is a string that reads …
1 / 15