Avatar

Organizations

17 results for 字符串
  • 字典  wordList 中从单词 beginWordendWord转换序列是一个按下述规格形成的序列

    \(beginWord \to s_1 \to s_2 \to \dots \to s_k\):

    • 每一对相邻的单词只差一个字母。
    • 对于  1 <= i <= k  时,每个 \(s_i\)  都在wordList  中。注意, beginWord 不需要在wordList  中。
    • \(s_k == endWord\)

    给你两个单词 beginWordendWord 和一个字典 wordList ,返回从  beginWord 到  endWord最短转换序列中的单词数目。如果不存在这样的转换序列,返回 0

  • 给定一个  m x n 二维字符网格  board 和一个单词(字符串)列表words返回所有二维网格上的单词 。

    单词必须按照字母顺序,通过 相邻的单元格内的字母构成,其中“相邻”单元格是那些水平相邻或垂直相邻的单元格。同一个单元格内的字母在一个单词中不允许被重复使用。

    leetcode 困难 字典树 数组 字符串 Created Tue, 27 Dec 2022 15:20:42 +0800
  • 给定一个字符串s,你可以通过在字符串前面添加字符将其转换为回文串。找到并返回可以用这种方式转换的最短回文串。

  • 给定一个字符串  (s) 和一个字符模式  (p),实现一个支持  '?'  和  '*'  的通配符匹配。

    leetcode 困难 贪心 递归 字符串 Created Tue, 06 Dec 2022 14:03:07 +0800
  • 给你一个由若干括号和字母组成的字符串 s,删除最小数量的无效括号,使得输入的字符串有效。

    返回所有可能的结果。答案可以按 任意顺序 返回。

  • 给你一个字符串 s 、一个字符串 t 。返回 s 中涵盖 t 所有字符的最小子串。如果 s 中不存在涵盖 t 所有字符的子串,则返回空字符串 ""

  • Given two integers representing the numerator and denominator of a fraction, return the fraction in string format.

    If the fractional part is repeating, enclose the repeating part in parentheses.

    If multiple answers are possible, return any of them.

    It is guaranteed that the length of the answer string is less than 104 for all the given inputs.

    leetcode 中等 哈希表 数学 字符串 Created Tue, 21 Jun 2022 15:53:27 +0800
  • Given a string s, return the longest palindromic substring in s.

    leetcode 中等 字符串 动态规划 Created Wed, 08 Jun 2022 13:14:02 +0800
  • 农夫约翰把杂志上所有的文章摘抄了下来并把它变成了一个长度不超过 106 的字符串 S。

    他希望从 S 中删除子串 T。

    农夫约翰在 S 中从头开始寻找子串 T,一旦找到,就将它从 S 中删除,然后再次从头开始寻找(而不是接着往下找)。

    他重复这个操作直到 S 中没有子串 T 为止。

    注意,删除一个子串 T 可能会导致一个新的子串 T 的出现。

    请帮助约翰完成这些操作并输出最后的 S。

    acwing 简单 字符串 Created Fri, 15 Apr 2022 13:43:00 +0800
  • You are building a string s of length n one character at a time, prepending each new character to the front of the string. The strings are labeled from 1 to n, where the string with length i is labeled \(s_i\).

    • For example, for \(s = “abaca”, s_1 == “a”, s_2 == “ca”, s_3 == “aca”\), etc.

    The score of \(s_i\) is the length of the longest common prefix between \(s_i\) and \(s_n\) (Note that \(s == s_n\)).

    Given the final string s, return the sum of the score of every \(s_i\).

    leetcode 困难 字符串 Created Sun, 03 Apr 2022 17:48:50 +0800
Next