随笔分类 -  String

摘要:Design a search autocomplete system for a search engine. Users may input a sentence (at least one word and end with a special character '#'). For each 阅读全文
posted @ 2019-07-15 05:34 北叶青藤 阅读(520) 评论(0) 推荐(0)
摘要: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 successor. For 阅读全文
posted @ 2019-07-08 05:36 北叶青藤 阅读(188) 评论(0) 推荐(0)
摘要:Solve a given equation and return the value of x in the form of string "x=#value". The equation contains only '+', '-' operation, the variable x and i 阅读全文
posted @ 2019-07-07 10:24 北叶青藤 阅读(356) 评论(0) 推荐(0)
摘要:Given a string, your task is to count how many palindromic substrings in this string. The substrings with different start indexes or end indexes are c 阅读全文
posted @ 2019-07-05 09:13 北叶青藤 阅读(166) 评论(0) 推荐(0)
摘要:Given a time represented in the format "HH:MM", form the next closest time by reusing the current digits. There is no limit on how many times a digit 阅读全文
posted @ 2019-05-28 07:27 北叶青藤 阅读(276) 评论(0) 推荐(0)
摘要:Given a string s and a non-empty string p, find all the start indices of p's anagrams in s. Strings consists of lowercase English letters only and the 阅读全文
posted @ 2019-04-28 11:21 北叶青藤 阅读(147) 评论(0) 推荐(0)
摘要:Given an encoded string, return it's decoded string.The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is be 阅读全文
posted @ 2019-04-22 01:48 北叶青藤 阅读(394) 评论(0) 推荐(0)
摘要:Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1. Examples: Note: You may assume the 阅读全文
posted @ 2019-03-24 08:54 北叶青藤 阅读(141) 评论(0) 推荐(0)
摘要:TinyURL is a URL shortening service where you enter a URL such as https://leetcode.com/problems/design-tinyurl and it returns a short URL such as http 阅读全文
posted @ 2019-02-23 11:41 北叶青藤 阅读(247) 评论(0) 推荐(0)
摘要:Basic Calculator I Implement a basic calculator to evaluate a simple expression string. The expression string may contain open ( and closing parenthes 阅读全文
posted @ 2019-02-18 02:42 北叶青藤 阅读(373) 评论(0) 推荐(0)
摘要:Given a string representing arbitrarily nested ternary expressions, calculate the result of the expression. You can always assume that the given expre 阅读全文
posted @ 2017-01-03 10:36 北叶青藤 阅读(220) 评论(0) 推荐(0)
摘要:Suppose we abstract our file system by a string in the following manner: The string "dir\n\tsubdir1\n\tsubdir2\n\t\tfile.ext" represents: dir subdir1 阅读全文
posted @ 2016-12-28 06:19 北叶青藤 阅读(199) 评论(0) 推荐(0)
摘要:Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the characters in s can be replaced to get t. All occurrenc 阅读全文
posted @ 2016-12-27 04:30 北叶青藤 阅读(234) 评论(0) 推荐(0)
摘要:Given an array of strings, group anagrams together. For example, given: ["eat", "tea", "tan", "ate", "nat", "bat"], Return: 阅读全文
posted @ 2016-12-13 14:58 北叶青藤 阅读(161) 评论(0) 推荐(0)
摘要:Given a string, sort it in decreasing order based on the frequency of characters. Example 1: Example 2: 阅读全文
posted @ 2016-11-20 09:42 北叶青藤 阅读(311) 评论(0) 推荐(0)
摘要:给你一个字符串和字典,从头扫到位,如果到当前的字符的字符串存在于字典中,则显示 buzz. 例子: ILOVEPINEAPPLEJUICE 字典: [pine, apple, pineapple, juice, applejuice] 那么当我们到达ILOVEPINE的时候,就要buzz,当我们到达 阅读全文
posted @ 2016-11-19 05:45 北叶青藤 阅读(446) 评论(0) 推荐(0)
摘要:Given a string that contains only digits 0-9 and a target value, return all possibilities to add binary operators (not unary) +, -, or *between the di 阅读全文
posted @ 2016-10-23 23:07 北叶青藤 阅读(235) 评论(0) 推荐(0)
摘要:Remove the minimum number of invalid parentheses in order to make the input string valid. Return all possible results. Note: The input string may cont 阅读全文
posted @ 2016-10-23 10:06 北叶青藤 阅读(271) 评论(0) 推荐(0)
摘要:An abbreviation of a word follows the form <first letter><number><last letter>. Below are some examples of word abbreviations: Assume you have a dicti 阅读全文
posted @ 2016-10-18 10:41 北叶青藤 阅读(206) 评论(0) 推荐(0)
摘要:The API: int read4(char *buf) reads 4 characters at a time from a file. The return value is the actual number of characters read. For example, it retu 阅读全文
posted @ 2016-08-08 10:11 北叶青藤 阅读(267) 评论(0) 推荐(0)