随笔分类 -  Google

1 2 3 4 5 ··· 10 下一页
摘要:his is an interactive problem. You are given an array of unique strings wordlist where wordlist[i] is 6 letters long, and one word in this list is cho 阅读全文
posted @ 2021-07-06 11:37 北叶青藤 阅读(55) 评论(0) 推荐(0)
摘要:You are given a string s representing an attendance record for a student where each character signifies whether the student was absent, late, or prese 阅读全文
posted @ 2021-07-06 11:04 北叶青藤 阅读(53) 评论(0) 推荐(0)
摘要:A Range Module is a module that tracks ranges of numbers. Design a data structure to track the ranges represented as half-open intervals and query abo 阅读全文
posted @ 2021-07-05 07:30 北叶青藤 阅读(59) 评论(0) 推荐(0)
摘要:You are a hiker preparing for an upcoming hike. You are given heights, a 2D array of size rows x columns, where heights[row][col] represents the heigh 阅读全文
posted @ 2021-07-05 07:23 北叶青藤 阅读(56) 评论(0) 推荐(0)
摘要:Given strings s1 and s2, return the minimum contiguous substring part of s1, so that s2 is a subsequence of the part. If there is no such window in s1 阅读全文
posted @ 2021-07-05 03:31 北叶青藤 阅读(50) 评论(0) 推荐(0)
摘要:Given a rows x cols screen and a sentence represented as a list of strings, return the number of times the given sentence can be fitted on the screen. 阅读全文
posted @ 2021-07-05 01:28 北叶青藤 阅读(58) 评论(0) 推荐(0)
摘要:You are given a data structure of employee information, which includes the employee's unique id, their importance value and their direct subordinates' 阅读全文
posted @ 2021-04-12 23:22 北叶青藤 阅读(59) 评论(0) 推荐(0)
摘要:Design a logger system that receives a stream of messages along with their timestamps. Each unique message should only be printed at most every 10 sec 阅读全文
posted @ 2021-04-12 22:44 北叶青藤 阅读(54) 评论(0) 推荐(0)
摘要:Create a timebased key-value store class TimeMap, that supports two operations. 1. set(string key, string value, int timestamp) Stores the key and val 阅读全文
posted @ 2021-03-12 09:40 北叶青藤 阅读(85) 评论(0) 推荐(0)
摘要:Given an integer array, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array will be 阅读全文
posted @ 2019-08-18 03:14 北叶青藤 阅读(159) 评论(0) 推荐(0)
摘要: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)
摘要:Design a Phone Directory which supports the following operations: get: Provide a number which is not assigned to anyone.check: Check if a number is av 阅读全文
posted @ 2019-08-11 02:21 北叶青藤 阅读(206) 评论(0) 推荐(0)
摘要:Given an array with distinct numbers, return an integer indicating the minimum number of swap operations required to sort the array into ascending ord 阅读全文
posted @ 2019-08-04 08:48 北叶青藤 阅读(211) 评论(0) 推荐(0)
摘要:Find the longest increasing subsequence in an array. If there are multiple, return one of them. Example, for [0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 阅读全文
posted @ 2019-08-04 05:34 北叶青藤 阅读(123) 评论(0) 推荐(0)
摘要:Find the second largest node in the BST 分析: 如果root有右节点,很明显第二大的node有可能在右子树里。唯一不满足的条件就是右子树只有一个node. 这个时候root就是第二大node. 所以我们需要把root(可能是第二大node)也传下去。 如果ro 阅读全文
posted @ 2019-07-30 13:23 北叶青藤 阅读(174) 评论(0) 推荐(0)
摘要:You want to build a house on an empty land which reaches all buildings in the shortest amount of distance. You can only move up, down, left and right. 阅读全文
posted @ 2019-07-29 03:11 北叶青藤 阅读(279) 评论(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 @ 2019-07-28 03:44 北叶青藤 阅读(282) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2019-07-28 03:22 北叶青藤 阅读(631) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2019-07-28 01:36 北叶青藤 阅读(249) 评论(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)

1 2 3 4 5 ··· 10 下一页