content_1729487674688.zip
大小:82.61KB
价格:36积分
下载量:0
评分:
5.0
上传者:d7_7777
更新日期:2025-09-22

content_1729487674688.zip

资源文件列表(大概)

文件名
大小
1056-完成任务的最少工作时间段 [minimum-number-of-work-sessions-to-finish-the-tasks].html
2.37KB
1104-将字符串翻转到单调递增 [flip-string-to-monotone-increasing].html
1.2KB
1116-将整数按权重排序 [sort-integers-by-the-power-value].html
2.26KB
1149-布尔运算 [boolean-evaluation-lcci].html
787B
1159-平衡括号字符串的最少插入次数 [minimum-insertions-to-balance-a-parentheses-string].html
2.48KB
1188-得到目标值的最少行动次数 [minimum-moves-to-reach-target-score].html
1.72KB
1198-快照数组 [snapshot-array].html
1.84KB
1203-恢复空格 [re-space-lcci].html
1.37KB
1210-我的日程安排表 I [my-calendar-i].html
1.82KB
1211-我的日程安排表 II [my-calendar-ii].html
2.28KB
1213-我能赢吗 [can-i-win].html
1.82KB
1227-所有排列中的最大和 [maximum-sum-obtained-of-any-permutation].html
2.33KB
1240-打家劫舍 II [house-robber-ii].html
1.41KB
1255-找两个和为目标值且不重叠的子数组 [find-two-non-overlapping-sub-arrays-each-with-target-sum].html
1.92KB
1263-找出最具竞争力的子序列 [find-the-most-competitive-subsequence].html
1.39KB
1286-找出输掉零场或一场比赛的玩家 [find-players-with-zero-or-one-losses].html
1.99KB
1288-找到 K 个最接近的元素 [find-k-closest-elements].html
1.13KB
1301-找到所有好下标 [find-all-good-indices].html
1.57KB
1308-找到需要补充粉笔的学生编号 [find-the-student-that-will-replace-the-chalk].html
2.59KB
1312-把数字翻译成字符串 [ba-shu-zi-fan-yi-cheng-zi-fu-chuan-lcof].html
771B
1313-把数组排成最小的数 [ba-shu-zu-pai-cheng-zui-xiao-de-shu-lcof].html
812B
1326-拼车 [car-pooling].html
1.48KB
1327-拿出最少数目的魔法豆 [removing-minimum-number-of-magic-beans].html
2.32KB
1332-按位或最大的最小子数组长度 [smallest-subarrays-with-maximum-bitwise-or].html
2.54KB
1344-按权重随机选择 [random-pick-with-weight].html
2.13KB
1349-按递增顺序显示卡牌 [reveal-cards-in-increasing-order].html
1.85KB
1361-排序数组中只出现一次的数字 [skFtm2].html
1.07KB
1368-推文计数 [tweet-counts-per-frequency].html
4.03KB
1378-搜索二维矩阵 [search-a-2d-matrix].html
1.12KB
1379-搜索二维矩阵 II [search-a-2d-matrix-ii].html
1.33KB
1382-搜索旋转排序数组 [search-in-rotated-sorted-array].html
1.71KB
1383-搜索旋转排序数组 II [search-in-rotated-sorted-array-ii].html
2.01KB
1386-摆动序列 [wiggle-subsequence].html
1.93KB
1387-摆动排序 II [wiggle-sort-ii].html
1.01KB
1391-摧毁小行星 [destroying-asteroids].html
1.97KB
1397-收集足够苹果的最小花园周长 [minimum-garden-perimeter-to-collect-enough-apples].html
1.64KB
1398-改变一个整数能得到的最大差值 [max-difference-you-can-get-from-changing-an-integer].html
2.02KB
1400-救生艇 [boats-to-save-people].html
1.22KB
1406-数字流的秩 [rank-from-stream-lcci].html
907B
1411-数对和 [pairs-with-sum-lcci].html
494B
1419-数组中最大数对和的最小值 [minimize-maximum-pair-sum-in-array].html
1.65KB
1421-数组中和为 0 的三个数 [1fGaJU].html
1.1KB
1424-数组中的 k 个最强值 [the-k-strongest-values-in-an-array].html
2.77KB
1458-整数替换 [integer-replacement].html
1.08KB
1475-旋转函数 [rotate-function].html
1.43KB
1486-无重叠区间 [non-overlapping-intervals].html
1.2KB
1531-有效的括号字符串 [valid-parenthesis-string].html
1.16KB
1607-检查数组是否存在有效划分 [check-if-there-is-a-valid-partition-for-the-array].html
1.64KB
1693-火柴拼正方形 [matchsticks-to-square].html
1.18KB
1713-猜数字大小 II [guess-number-higher-or-lower-ii].html
3.81KB
1723-环形房屋偷盗 [PzWKhm].html
1.65KB
1731-球会落何处 [where-will-the-ball-fall].html
2.46KB
1808-硬币 [coin-lcci].html
741B
1865-粉刷房子 [JEj789].html
1.62KB
1900-统计全 1 子矩形 [count-submatrices-with-all-ones].html
1.59KB
2155-连续子数组的最大和 [lian-xu-zi-shu-zu-de-zui-da-he-lcof].html
762B
2158-连续数列 [contiguous-sequence-lcci].html
444B
361-使字符串有序的最少操作次数 [minimum-number-of-operations-to-make-string-sorted].html
2.49KB
419-公平分发饼干 [fair-distribution-of-cookies].html
1.75KB
427-最低票价 [minimum-cost-for-tickets].html
2.72KB
428-最佳买卖股票时机含冷冻期 [best-time-to-buy-and-sell-stock-with-cooldown].html
1.08KB
454-最大加号标志 [largest-plus-sign].html
1.95KB
476-最大的以 1 为边界的正方形 [largest-1-bordered-square].html
829B
488-最大黑方阵 [max-black-square-lcci].html
1.12KB
563-最长回文子串 [longest-palindromic-substring].html
589B
575-最长理想子序列 [longest-ideal-subsequence].html
1.69KB
698-判断子序列 [is-subsequence].html
1.25KB
889-回文子字符串的个数 [a7VOhD].html
1023B
923-地图分析 [as-far-from-land-as-possible].html
1.84KB
957-多米诺和托米诺平铺 [domino-and-tromino-tiling].html
1.21KB
算法设计与分析任务汇报选题单.xlsx
13.4KB

资源内容介绍

content_1729487674688.zip
<p>一家社交媒体公司正试图通过分析特定时间段内出现的推文数量来监控其网站上的活动。这些时间段可以根据特定的频率(&nbsp;<strong>每分钟&nbsp;</strong>、<strong>每小时&nbsp;</strong>或 <strong>每一天</strong> )划分为更小的 <strong>时间段</strong> 。</p><p>&nbsp;</p><p>例如,周期 <code>[10,10000]</code>&nbsp;(以 <strong>秒</strong> 为单位)将被划分为以下频率的 <strong>时间块</strong> :</p><ul><li>每 <strong>分钟</strong> (60秒 块):<meta charset="UTF-8" />&nbsp;<code>[10,69]</code>,&nbsp;<code>[70,129]</code>,&nbsp;<code>[130,189]</code>,&nbsp;<code>...</code>,&nbsp;<code>[9970,10000]</code></li><li>每 <strong>小时</strong> (3600秒 块):<meta charset="UTF-8" /><code>[10,3609]</code>,&nbsp;<code>[3610,7209]</code>,&nbsp;<code>[7210,10000]</code></li><li>每 <strong>天</strong> (86400秒 块):<meta charset="UTF-8" />&nbsp;<code>[10,10000]</code></li></ul><p>注意,最后一个块可能比指定频率的块大小更短,并且总是以时间段的结束时间结束(在上面的示例中为 <code>10000</code> )。</p><p>设计和实现一个API来帮助公司进行分析。</p><p>实现 <code>TweetCounts</code> 类:</p><ul><li><code>TweetCounts()</code> 初始化 <code>TweetCounts</code> 对象。</li><li>存储记录时间的 <code>tweetName</code> (以秒为单位)。</li><li><code>List&lt;integer&gt; getTweetCountsPerFrequency(String freq, String tweetName, int startTime, int endTime)</code>&nbsp;返回一个整数列表,表示给定时间 <code>[startTime, endTime]</code>&nbsp;(单位秒)和频率频率中,每个 <strong>时间块</strong> 中带有 <code>tweetName</code> 的 <code>tweet</code> 的数量。<ul><li><code>freq</code> 是 <code>“minute”</code> 、 <code>“hour”</code> 或 <code>“day”</code> 中的一个,分别表示 <strong>每分钟</strong> 、 <strong>每小时</strong> 或 <strong>每一天</strong> 的频率。</li></ul></li></ul><p>&nbsp;</p><p><strong>示例:</strong></p><pre><strong>输入:</strong>["TweetCounts","recordTweet","recordTweet","recordTweet","getTweetCountsPerFrequency","getTweetCountsPerFrequency","recordTweet","getTweetCountsPerFrequency"][[],["tweet3",0],["tweet3",60],["tweet3",10],["minute","tweet3",0,59],["minute","tweet3",0,60],["tweet3",120],["hour","tweet3",0,210]]<strong>输出:</strong>[null,null,null,null,[2],[2,1],null,[4]]<strong>解释:</strong>TweetCounts tweetCounts = new TweetCounts();tweetCounts.recordTweet("tweet3", 0);tweetCounts.recordTweet("tweet3", 60);tweetCounts.recordTweet("tweet3", 10); //&nbsp;"tweet3"&nbsp;发布推文的时间分别是&nbsp;0,&nbsp;10&nbsp;和&nbsp;60 。tweetCounts.getTweetCountsPerFrequency("minute", "tweet3", 0, 59); //&nbsp;返回&nbsp;[2]。统计频率是每分钟(60 秒),因此只有一个有效时间间隔 [0,60&gt;&nbsp;-&nbsp;&gt;&nbsp;2&nbsp;条推文。tweetCounts.getTweetCountsPerFrequency("minute", "tweet3", 0, 60); //&nbsp;返回&nbsp;[2,1]。统计频率是每分钟(60 秒),因此有两个有效时间间隔&nbsp;<strong>1)</strong>&nbsp;[0,60&gt;&nbsp;-&nbsp;&gt;&nbsp;2&nbsp;条推文,和&nbsp;<strong>2)</strong>&nbsp;[60,61&gt;&nbsp;-&nbsp;&gt;&nbsp;1&nbsp;条推文。 tweetCounts.recordTweet("tweet3", 120); // "tweet3"&nbsp;发布推文的时间分别是 0, 10, 60 和 120 。tweetCounts.getTweetCountsPerFrequency("hour", "tweet3", 0, 210); //&nbsp;返回&nbsp;[4]。统计频率是每小时(3600 秒),因此只有一个有效时间间隔 [0,211&gt;&nbsp;-&nbsp;&gt;&nbsp;4&nbsp;条推文。</pre><p>&nbsp;</p><p><strong>提示:</strong></p><ul><li><code>0 &lt;= time, startTime, endTime &lt;= 10<sup>9</sup></code></li><li><code>0 &lt;= endTime - startTime &lt;= 10<sup>4</sup></code></li><li><code>recordTweet</code>&nbsp;和&nbsp;<code>getTweetCountsPerFrequency</code>,最多有<meta charset="UTF-8" />&nbsp;<code>10<sup>4</sup></code>&nbsp;次操作。</li></ul>

用户评论 (0)

发表评论

captcha