Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 8a3c77b

Browse files
refactor 362
1 parent c12b8c2 commit 8a3c77b

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
private int[] hits;
1414
private int k;
1515

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

25-
/**
26-
* Record a hit.
27-
*
28-
* @param timestamp - The current timestamp (in seconds granularity).
29-
*/
3022
public void hit(int timestamp) {
3123
int index = 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
public int getHits(int timestamp) {
4633
int total = 0;
4734
for (int i = 0; i < k; i++) {

0 commit comments

Comments
 (0)