摘要:
Given an array of integers nums and an integer k, return the total number of subarrays whose sum equals to k. A subarray is a contiguous non-empty seq 阅读全文
posted @ 2020-04-14 12:28
CNoodle
阅读(390)
评论(0)
推荐(0)
摘要:
Given a binary array nums, return the maximum length of a contiguous subarray with an equal number of 0 and 1. Example 1: Input: nums = [0,1] Output: 阅读全文
posted @ 2020-04-14 10:12
CNoodle
阅读(234)
评论(0)
推荐(0)
摘要:
You are given an array of integers stones where stones[i] is the weight of the ith stone. We are playing a game with the stones. On each turn, we choo 阅读全文
posted @ 2020-04-14 08:38
CNoodle
阅读(135)
评论(0)
推荐(0)
摘要:
Given a string s and an integer k, rearrange s such that the same characters are at least distance k from each other. If it is not possible to rearran 阅读全文
posted @ 2020-04-14 08:13
CNoodle
阅读(791)
评论(0)
推荐(0)
摘要:
Given a string s, rearrange the characters of s so that any two adjacent characters are not the same. Return any possible rearrangement of s or return 阅读全文
posted @ 2020-04-14 06:40
CNoodle
阅读(285)
评论(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 granulari 阅读全文
posted @ 2020-04-14 04:11
CNoodle
阅读(344)
评论(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 @ 2020-04-14 02:01
CNoodle
阅读(186)
评论(0)
推荐(0)