
deque
文章平均质量分 88
flyatcmu
这个作者很懒,什么都没留下…
展开
-
Minimum Moves to Move a Box to Their Target Location
A storekeeper is a game in which the player pushes boxes around in a warehouse trying to get them to target locations.The game is represented by anm x ngrid of charactersgridwhere each element is a wall, floor, or box.Your task is to move the box'...原创 2022-03-28 10:54:01 · 447 阅读 · 0 评论 -
Step-By-Step Directions From a Binary Tree Node to Another
You are given therootof abinary treewithnnodes. Each node is uniquely assigned a value from1ton. You are also given an integerstartValuerepresenting the value of the start nodes, and a different integerdestValuerepresenting the value of the d...原创 2021-12-06 05:07:13 · 245 阅读 · 0 评论 -
Shortest Subarray with Sum at Least K
Return thelengthof the shortest, non-empty, contiguoussubarray ofAwith sum at leastK.If there is no non-empty subarray with sum at leastK, return-1.Example 1:Input: A = [1], K = 1Output: 1Example 2:Input: A = [1,2], K = 4Output: -1...原创 2020-06-25 10:44:35 · 377 阅读 · 0 评论 -
Design Hit Counter
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 mad原创 2016-07-22 07:22:53 · 528 阅读 · 0 评论 -
Web Logger
Implement a web logger, which provide two methods:hit(timestamp), record a hit at given timestamp. get_hit_count_in_last_5_minutes(timestamp), get hit count in last 5 minutes.the two methods will ...原创 2020-01-21 11:46:33 · 389 阅读 · 0 评论 -
Sliding Window Maximum
Given an arraynums, there is a sliding window of sizekwhich is moving from the very left of the array to the very right. You can only see theknumbers in the window. Each time the sliding window...原创 2016-09-06 12:23:56 · 350 阅读 · 0 评论