Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8a3c77b

Browse files
refactor 362
1 parentc12b8c2 commit8a3c77b

File tree

1 file changed

+0
-13
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+0
-13
lines changed

‎src/main/java/com/fishercoder/solutions/_362.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,12 @@ public static class HitCounter {
1313
privateint[]hits;
1414
privateintk;
1515

16-
/**
17-
* Initialize your data structure here.
18-
*/
1916
publicHitCounter() {
2017
k =300;
2118
times =newint[k];
2219
hits =newint[k];
2320
}
2421

25-
/**
26-
* Record a hit.
27-
*
28-
* @param timestamp - The current timestamp (in seconds granularity).
29-
*/
3022
publicvoidhit(inttimestamp) {
3123
intindex =timestamp %k;
3224
if (times[index] !=timestamp) {
@@ -37,11 +29,6 @@ public void hit(int timestamp) {
3729
}
3830
}
3931

40-
/**
41-
* Return the number of hits in the past 5 minutes.
42-
*
43-
* @param timestamp - The current timestamp (in seconds granularity).
44-
*/
4532
publicintgetHits(inttimestamp) {
4633
inttotal =0;
4734
for (inti =0;i <k;i++) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp