随笔分类 -  Level 4

摘要:Your task is to design the basic function of Excel and implement the function of sum formula. Specifically, you need to implement the following functi 阅读全文
posted @ 2019-08-12 09:14 北叶青藤 阅读(337) 评论(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)
摘要: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 阅读全文
posted @ 2019-07-18 12:01 北叶青藤 阅读(284) 评论(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)
摘要:Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or 阅读全文
posted @ 2019-07-06 11:56 北叶青藤 阅读(321) 评论(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)
摘要:There is a new alien language which uses the latin alphabet. However, the order among letters are unknown to you. You receive a list of words from the 阅读全文
posted @ 2016-09-01 23:07 北叶青藤 阅读(286) 评论(0) 推荐(0)
摘要:Validate if a given string is numeric. Some examples:"0" => true" 0.1 " => true"abc" => false"1 a" => false"2e10" => true Note: It is intended for the 阅读全文
posted @ 2016-08-05 23:11 北叶青藤 阅读(264) 评论(0) 推荐(0)
摘要:The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font 阅读全文
posted @ 2016-08-05 11:49 北叶青藤 阅读(239) 评论(0) 推荐(0)
摘要:Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloon 阅读全文
posted @ 2016-07-24 04:29 北叶青藤 阅读(233) 评论(0) 推荐(0)
摘要:Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two 阅读全文
posted @ 2016-07-21 02:46 北叶青藤 阅读(200) 评论(0) 推荐(0)
摘要:Given an array of n integer with duplicate number, and a moving window(size k), move the window at each iteration from the start of the array, find th 阅读全文
posted @ 2016-07-20 05:33 北叶青藤 阅读(160) 评论(0) 推荐(0)
摘要:Given three strings: s1, s2, s3, determine whether s3 is formed by the interleaving of s1 and s2. Given three strings: s1, s2, s3, determine whether s 阅读全文
posted @ 2016-07-19 02:21 北叶青藤 阅读(172) 评论(0) 推荐(0)
摘要:Given a permutation which contains no repeated number, find its index in all the permutations of these numbers, which are ordered in lexicographical o 阅读全文
posted @ 2016-07-19 00:43 北叶青藤 阅读(332) 评论(0) 推荐(0)
摘要:Given n and k, return the k-th permutation sequence. Notice n will be between 1 and 9 inclusive. Given n and k, return the k-th permutation sequence. 阅读全文
posted @ 2016-07-18 12:57 北叶青藤 阅读(245) 评论(0) 推荐(0)
摘要:Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put. get(key) - Get the 阅读全文
posted @ 2016-07-15 22:48 北叶青藤 阅读(379) 评论(0) 推荐(0)
摘要:Find the kth smallest number in at row and column sorted matrix. Example Given k = 4 and a matrix: [ [1 ,5 ,7], [3 ,7 ,8], [4 ,8 ,9], ] return 5. 分析: 阅读全文
posted @ 2016-07-14 02:29 北叶青藤 阅读(308) 评论(0) 推荐(0)
摘要:Divide two integers without using multiplication, division and mod operator. If it is overflow, return 2147483647 Example Given dividend = 100 and div 阅读全文
posted @ 2016-07-13 22:39 北叶青藤 阅读(167) 评论(0) 推荐(0)
摘要:Design an algorithm and write code to serialize and deserialize a binary tree. Writing the tree to a file is called 'serialization' and reading back f 阅读全文
posted @ 2016-07-05 06:06 北叶青藤 阅读(178) 评论(0) 推荐(0)
摘要:Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the hist 阅读全文
posted @ 2016-06-30 12:11 北叶青藤 阅读(283) 评论(0) 推荐(0)