随笔分类 -  Affirm

摘要: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 阅读全文
posted @ 2019-08-08 00:35 北叶青藤 阅读(457) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2019-08-08 00:24 北叶青藤 阅读(288) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2019-08-08 00:14 北叶青藤 阅读(384) 评论(0) 推荐(0)
摘要:Postfix to Prefix Conversion Postfix: An expression is called the postfix expression if the operator appears in the expression after the operands. Sim 阅读全文
posted @ 2019-08-08 00:07 北叶青藤 阅读(466) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2019-08-05 04:52 北叶青藤 阅读(279) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2019-07-27 14:18 北叶青藤 阅读(282) 评论(0) 推荐(0)
摘要:Design a hit counter which counts the number of hits received in the past 5 minutes. Each function accepts a timestamp parameter (in seconds granularity) and you may assume that calls are being made ... 阅读全文
posted @ 2019-07-26 13:53 北叶青藤 阅读(197) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2019-07-22 13:02 北叶青藤 阅读(356) 评论(0) 推荐(0)
摘要:Your are given an array of positive integers nums. Count and print the number of (contiguous) subarrays where the product of all the elements in the s 阅读全文
posted @ 2019-07-20 16:08 北叶青藤 阅读(274) 评论(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-07-20 13:08 北叶青藤 阅读(356) 评论(0) 推荐(0)
摘要:Design and implement a data structure for Least Frequently Used (LFU) cache. It should support the following operations: getand put. get(key) - Get th 阅读全文
posted @ 2019-07-17 12:48 北叶青藤 阅读(232) 评论(0) 推荐(0)
摘要:Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Note: You may assume k is always valid, 1 ≤ k ≤ BST's 阅读全文
posted @ 2019-04-28 12:46 北叶青藤 阅读(214) 评论(0) 推荐(0)
摘要:Given a non-empty 2D array grid of 0's and 1's, an island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) Yo 阅读全文
posted @ 2019-02-03 07:59 北叶青藤 阅读(185) 评论(0) 推荐(0)
摘要:Determine whether an integer is a palindrome. Do this without extra space. 分析:把一个数倒过来,然后看两个数是否相同。 Reverse digits of an integer. Example1: x = 123, ret 阅读全文
posted @ 2016-12-29 00:15 北叶青藤 阅读(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)
摘要:Design a data structure that supports all following operations in O(1) time. insert(val): Inserts an item val to the set if not already present.remove 阅读全文
posted @ 2016-12-08 10:51 北叶青藤 阅读(253) 评论(0) 推荐(0)
摘要:Nested List Weight Sum I Given a nested list of integers, return the sum of all integers in the list weighted by their depth. Each element is either a 阅读全文
posted @ 2016-08-01 02:55 北叶青藤 阅读(327) 评论(0) 推荐(0)
摘要:Design an algorithm to encode a list of strings to a string. The encoded string is then sent over the network and is decoded back to the original list 阅读全文
posted @ 2016-07-28 06:43 北叶青藤 阅读(229) 评论(0) 推荐(0)
摘要:Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). You are given a target va 阅读全文
posted @ 2016-07-22 10:59 北叶青藤 阅读(170) 评论(0) 推荐(0)
摘要:Given a nested list of integers, implement an iterator to flatten it. Each element is either an integer, or a list -- whose elements may also be integ 阅读全文
posted @ 2016-07-22 00:28 北叶青藤 阅读(213) 评论(0) 推荐(0)