随笔分类 - String
摘要:窗口也可以用 int[] map = new int[26];https://leetcode.com/problems/find-all-anagrams-in-a-string/discuss/636988/Sliding-Window-or-HashTable-or-Java-Explaine
阅读全文
摘要:Given an array of strings words (without duplicates), return all the concatenated words in the given list of words. A concatenated word is defined as
阅读全文
摘要:Given a column title as appear in an Excel sheet, return its corresponding column number. For example: A -> 1 B -> 2 C -> 3 ... Z -> 26 AA -> 27 AB ->
阅读全文
摘要:Given a list of non-negative integers nums, arrange them such that they form the largest number. Note: The result may be very large, so you need to re
阅读全文
摘要:Given an array of strings strs, group the anagrams together. You can return the answer in any order. An Anagram is a word or phrase formed by rearrang
阅读全文
摘要:Given two strings s and t , write a function to determine if t is an anagram of s. Example 1: Input: s = "anagram", t = "nagaram" Output: true Example
阅读全文
摘要:Given a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome. Example 1: Input: "aba" Output: True Exa
阅读全文
摘要:Given an input string s, reverse the order of the words. A word is defined as a sequence of non-space characters. The words in s will be separated by
阅读全文
摘要:[抄题]: Given two strings A and B, find the minimum number of times A has to be repeated such that B is a substring of it. If no such solution, return -
阅读全文
摘要:[抄题]: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example,"A man, a plan, a cana
阅读全文
摘要:[抄题]: [暴力解法]: 时间分析: 空间分析: [奇葩输出条件]: [奇葩corner case]: [思维问题]: 没想到while循环 [一句话思路]: 先要把字符串转成数组,再转回来,数据结构白学了? [输入量]:空: 正常情况:特大:特小:程序里处理到的特殊情况:异常情况(不合法不合理的
阅读全文
摘要:[抄题]: You are given an array A of strings. Two strings S and T are special-equivalent if after any number of moves, S == T. A move consists of choosin
阅读全文
摘要:[抄题]: You have a list of words and a pattern, and you want to know which words in words matches the pattern. A word matches the pattern if there exist
阅读全文
摘要:[抄题]: Given a non-negative integer N, find the largest number that is less than or equal to N with monotone increasing digits. (Recall that an integer
阅读全文
摘要:[抄题]: In English, we have a concept called root, which can be followed by some other words to form another longer word - let's call this word successo
阅读全文
摘要:[抄题]: Given a string, we can "shift" each of its letter to its successive letter, for example: "abc" -> "bcd". We can keep "shifting" which forms the
阅读全文
摘要:[抄题]: Given a positive 32-bit integer n, you need to find the smallest 32-bit integer which has exactly the same digits existing in the integer n and
阅读全文
摘要:[抄题]: Given two strings S and T, return if they are equal when both are typed into empty text editors. # means a backspace character. Example 1: Input
阅读全文
摘要:[抄题]: A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down). Find all strobogrammatic numbers that
阅读全文
摘要:[抄题]: Given two strings s1 and s2, write a function to return true if s2 contains the permutation of s1. In other words, one of the first string's per
阅读全文

浙公网安备 33010602011771号