随笔分类 - String
摘要:You are given a string s and an integer k. You can choose any character of the string and change it to any other uppercase English character. You can
阅读全文
摘要:his is an interactive problem. You are given an array of unique strings wordlist where wordlist[i] is 6 letters long, and one word in this list is cho
阅读全文
摘要:You are given a string s representing an attendance record for a student where each character signifies whether the student was absent, late, or prese
阅读全文
摘要:Given strings s1 and s2, return the minimum contiguous substring part of s1, so that s2 is a subsequence of the part. If there is no such window in s1
阅读全文
摘要:Given a rows x cols screen and a sentence represented as a list of strings, return the number of times the given sentence can be fitted on the screen.
阅读全文
摘要:You have a lock in front of you with 4 circular wheels. Each wheel has 10 slots: '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'. The wheels can rota
阅读全文
摘要:S and T are strings composed of lowercase letters. In S, no letter occurs more than once. S was sorted in some custom order previously. We want to per
阅读全文
摘要:Given a string S, check if the letters can be rearranged so that two characters that are adjacent to each other are not the same. If possible, output
阅读全文
摘要:Given a non-negative integer, you could swap two digits at most once to get the maximum valued number. Return the maximum valued number you could get.
阅读全文
摘要:Given a string S of '(' and ')' parentheses, we add the minimum number of parentheses ( '(' or ')', and in any positions ) so that the resulting paren
阅读全文
摘要:Given a string s, a k duplicate removal consists of choosing k adjacent and equal letters from s and removing them causing the left and the right side
阅读全文
摘要:Given a string s containing only three types of characters: '(', ')' and '*', return true if s is valid. The following rules define a valid string: An
阅读全文
摘要:第一题一个四位数的密码锁,初始状态为0000, 输入解锁密码,返回最少多少个move可以解开。热身题,考虑几个异常输入即可。 比如说输入 1111, 结果是4输入0000, 结果是0 输入9999, 结果是4 就是算一下每一位input算 Math.Min(input - '0', '9' - in
阅读全文
摘要:From any string, we can form a subsequence of that string by deleting some number of characters (possibly no deletions). Given two strings source and
阅读全文
摘要:Given a non-empty string s and an abbreviation abbr, return whether the string matches with the given abbreviation. A string such as "word" contains o
阅读全文
摘要:Given a list of folders, remove all sub-folders in those folders and return in any order the folders after removing. If a folder[i] is located within
阅读全文
摘要:Given a string s and a list of strings dict, you need to add a closed pair of bold tag <b> and </b> to wrap the substrings in s that exist in dict. If
阅读全文
摘要: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 permutati
阅读全文
摘要: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: S =
阅读全文
摘要:Given a string s and an integer k, find out if the given string is a K-Palindrome or not. A string is K-Palindrome if it can be transformed into a pal
阅读全文

浙公网安备 33010602011771号