随笔分类 -  String

摘要:Implement a basic calculator to evaluate a simple expression string. The expression string may contain open ( and closing parentheses ), the plus + or 阅读全文
posted @ 2019-05-03 11:32 Veritas_des_Liberty 阅读(191) 评论(0) 推荐(0)
摘要:We are given two arrays A and B of words. Each word is a string of lowercase letters. Now, say that word b is a subset of word a if every letter in b  阅读全文
posted @ 2019-04-30 20:48 Veritas_des_Liberty 阅读(218) 评论(0) 推荐(0)
摘要:A string S of lowercase letters is given. Then, we may make any number of moves. In each move, we choose one of the first K letters (starting from the 阅读全文
posted @ 2019-04-30 18:00 Veritas_des_Liberty 阅读(297) 评论(0) 推荐(0)
摘要:Given a balanced parentheses string S, compute the score of the string based on the following rule: () has score 1 AB has score A + B, where A and B a 阅读全文
posted @ 2019-04-29 22:07 Veritas_des_Liberty 阅读(215) 评论(0) 推荐(0)
摘要:To some string S, we will perform some replacement operations that replace groups of letters with new ones (not necessarily the same size). Each repla 阅读全文
posted @ 2019-04-29 21:27 Veritas_des_Liberty 阅读(311) 评论(0) 推荐(0)
摘要:We had some 2-dimensional coordinates, like "(1, 3)" or "(2, 0.5)". Then, we removed all commas, decimal points, and spaces, and ended up with the str 阅读全文
posted @ 2019-04-28 21:33 Veritas_des_Liberty 阅读(239) 评论(0) 推荐(0)
摘要:You are given a string expression representing a Lisp-like expression to return the integer value of. The syntax for these expressions is given as fol 阅读全文
posted @ 2019-04-26 19:27 Veritas_des_Liberty 阅读(353) 评论(0) 推荐(0)
摘要:Give a string s, count the number of non-empty (contiguous) substrings that have the same number of 0's and 1's, and all the 0's and all the 1's in th 阅读全文
posted @ 2019-04-25 22:12 Veritas_des_Liberty 阅读(238) 评论(0) 推荐(0)
摘要:Given a string representing a code snippet, you need to implement a tag validator to parse the code and return whether it is valid. A code snippet is 阅读全文
posted @ 2019-04-23 12:46 Veritas_des_Liberty 阅读(343) 评论(0) 推荐(0)
摘要:Given an integer n, find the closest integer (not including itself), which is a palindrome. The 'closest' is defined as absolute difference minimized 阅读全文
posted @ 2019-04-22 22:32 Veritas_des_Liberty 阅读(288) 评论(0) 推荐(0)
摘要:Given a positive 32-bit integer n, you need to find the smallest 32-bit integer which has exactly the same digits existing in the integer n and is gre 阅读全文
posted @ 2019-04-22 21:37 Veritas_des_Liberty 阅读(283) 评论(0) 推荐(0)
摘要:Convert a non-negative integer to its english words representation. Given input is guaranteed to be less than 231 - 1. Example 1: Input: 123 Output: " 阅读全文
posted @ 2019-04-16 11:21 Veritas_des_Liberty 阅读(172) 评论(0) 推荐(0)
摘要:Implement a basic calculator to evaluate a simple expression string. The expression string contains only non-negative integers, +, -, *, / operators a 阅读全文
posted @ 2019-04-15 21:21 Veritas_des_Liberty 阅读(151) 评论(0) 推荐(0)