随笔分类 -  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 阅读全文
posted @ 2024-12-27 02:04 北叶青藤 阅读(25) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-07-06 11:37 北叶青藤 阅读(55) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-07-06 11:04 北叶青藤 阅读(53) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-07-05 03:31 北叶青藤 阅读(50) 评论(0) 推荐(0)
摘要: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. 阅读全文
posted @ 2021-07-05 01:28 北叶青藤 阅读(58) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-04-08 07:48 北叶青藤 阅读(83) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-04-08 02:53 北叶青藤 阅读(46) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-03-29 06:23 北叶青藤 阅读(60) 评论(0) 推荐(0)
摘要: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. 阅读全文
posted @ 2021-03-29 05:18 北叶青藤 阅读(39) 评论(0) 推荐(0)
摘要:Given a string S of '(' and ')' parentheses, we add the minimum number of parentheses ( '(' or ')', and in any positions ) so that the resulting paren 阅读全文
posted @ 2021-03-29 05:13 北叶青藤 阅读(41) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-03-28 23:49 北叶青藤 阅读(77) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-03-28 23:32 北叶青藤 阅读(77) 评论(0) 推荐(0)
摘要:第一题一个四位数的密码锁,初始状态为0000, 输入解锁密码,返回最少多少个move可以解开。热身题,考虑几个异常输入即可。 比如说输入 1111, 结果是4输入0000, 结果是0 输入9999, 结果是4 就是算一下每一位input算 Math.Min(input - '0', '9' - in 阅读全文
posted @ 2021-03-13 06:57 北叶青藤 阅读(109) 评论(0) 推荐(0)
摘要: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  阅读全文
posted @ 2021-03-13 04:56 北叶青藤 阅读(80) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-03-12 14:30 北叶青藤 阅读(89) 评论(0) 推荐(0)
摘要: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  阅读全文
posted @ 2021-03-12 13:01 北叶青藤 阅读(72) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-03-12 11:26 北叶青藤 阅读(84) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-12-27 03:24 北叶青藤 阅读(74) 评论(0) 推荐(0)
摘要: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 = 阅读全文
posted @ 2020-12-16 07:55 北叶青藤 阅读(121) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-02-08 00:04 北叶青藤 阅读(294) 评论(0) 推荐(0)