随笔分类 - String
摘要:Given a string S of lowercase letters, a duplicate removal consists of choosing two adjacent and equal letters, and removing them. We repeatedly make
阅读全文
摘要:Given two non-negative integers num1 and num2 represented as string, return the sum of num1 and num2. Note: The length of both num1 and num2 is < 5100
阅读全文
摘要:Given a string s of '(' , ')' and lowercase English characters. Your task is to remove the minimum number of parentheses ( '(' or ')', in any position
阅读全文
摘要:Given two sentences words1, words2 (each represented as an array of strings), and a list of similar word pairs pairs, determine if two sentences are s
阅读全文
摘要: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
阅读全文
摘要:In an alien language, surprisingly they also use english lowercase letters, but possibly in a different order. The order of the alphabet is some permu
阅读全文
摘要:问题一: pi表示取第i个单,di表示送第i个单。di不能在pi的前面。给一个取单送单的顺序,问是否是valid顺序。 1 public boolean isValidOrderList(List<String> list) { 2 Set<String> set = new HashSet<>()
阅读全文
摘要:Infix : An expression is called the Infix expression if the operator appears in between the operands in the expression. Simply of the form (operand1 o
阅读全文
摘要:Infix expression: The expression of the form a op b. When an operator is in-between every pair of operands.Postfix expression: The expression of the f
阅读全文
摘要:Infix : An expression is called the Infix expression if the operator appears in between the operands in the expression. Simply of the form (operand1 o
阅读全文
摘要:Postfix to Prefix Conversion Postfix: An expression is called the postfix expression if the operator appears in the expression after the operands. Sim
阅读全文
摘要:You are given a string with lower case letters only. Compress it by putting the count of the letter after it. If the letter appears once, Example: com
阅读全文
摘要:Given a list of directory info including directory path, and all the files with contents in this directory, you need to find out all the groups of dup
阅读全文
摘要:Two strings X and Y are similar if we can swap two letters (in different positions) of X, so that it equals Y. For example, "tars" and "rats" are simi
阅读全文
摘要:Given many words, words[i] has weight i. Design a class WordFilter that supports one function, WordFilter.f(String prefix, String suffix). It will ret
阅读全文
摘要:You are given several logs that each log contains a unique id and timestamp. Timestamp is a string that has the following format: Year:Month:Day:Hour:
阅读全文
摘要:Example : Infix : (A+B) * (C-D) ) Postfix: AB+CD-* 算法: 1. Scan the infix expression from left to right. 2. If the scanned character is an operand, app
阅读全文
摘要:Given a list of strings, output the most frequent characters that are in the same group as the letter. For example, for string "abc", a, b,c are in th
阅读全文
摘要:Given a rows x cols screen and a sentence represented by a list of words, find how many times the given sentence can be fitted on the screen. Note: A
阅读全文
摘要:Given a string S, find the number of different non-empty palindromic subsequences in S, and return that number modulo 10^9 + 7. A subsequence of a str
阅读全文

浙公网安备 33010602011771号