随笔分类 -  string 6

524. Longest Word in Dictionary through Deleting
摘要:Given a string and a string dictionary, find the longest string in the dictionary that can be formed by deleting some characters of the given string. If there are more than one possible results, retu... 阅读全文

posted @ 2018-11-09 11:28 猪猪🐷

792. Number of Matching Subsequences
摘要:Given string S and a dictionary of words words, find the number of words[i] that is a subsequence of S. Example : Input: S = "abcde" words = ["a", "bb", "acd", "ace"] Output: 3 Explanation: Ther... 阅读全文

posted @ 2018-11-09 11:04 猪猪🐷

451. Sort Characters By Frequency
摘要:Given a string, sort it in decreasing order based on the frequency of characters. Example 1: Input: "tree" Output: "eert" Explanation: 'e' appears twice while 'r' and 't' both appear once. So 'e' m... 阅读全文

posted @ 2018-11-09 07:20 猪猪🐷

482. License Key Formatting
摘要:You are given a license key represented as a string S which consists only alphanumeric character and dashes. The string is separated into N+1 groups b 阅读全文

posted @ 2018-11-08 16:36 猪猪🐷

748. Shortest Completing Word
摘要:Find the minimum length word from a given dictionary words, which has all the letters from the string licensePlate. Such a word is said to complete the given string licensePlate Here, for letters we ... 阅读全文

posted @ 2018-11-08 02:34 猪猪🐷

791. Custom Sort String
摘要:Use char[] array 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 permute the characters of T so t... 阅读全文

posted @ 2018-11-08 02:34 猪猪🐷

161 One edit distance
摘要:Given two strings s and t, determine if they are both one edit distance apart. Note: There are 3 possiblities to satisify one edit distance apart: Exa 阅读全文

posted @ 2018-08-09 17:42 猪猪🐷

导航