Skip to content

Commit e63e892

Browse files
refactor 359
1 parent 7da4e38 commit e63e892

File tree

1 file changed

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

1 file changed

+0
-29
lines changed

src/main/java/com/fishercoder/solutions/_359.java

-29
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,7 @@
44
import java.util.HashSet;
55
import java.util.Map;
66
import java.util.Set;
7-
/**
8-
* 359. Logger Rate Limiter
9-
*
10-
* Design a logger system that receive stream of messages along with its timestamps, each message should be printed if and only if it is not printed in the last 10 seconds.
117

12-
Given a message and a timestamp (in seconds granularity), return true if the message should be printed in the given timestamp, otherwise returns false.
13-
14-
It is possible that several messages arrive roughly at the same time.
15-
16-
Example:
17-
18-
Logger logger = new Logger();
19-
20-
// logging string "foo" at timestamp 1
21-
logger.shouldPrintMessage(1, "foo"); returns true;
22-
23-
// logging string "bar" at timestamp 2
24-
logger.shouldPrintMessage(2,"bar"); returns true;
25-
26-
// logging string "foo" at timestamp 3
27-
logger.shouldPrintMessage(3,"foo"); returns false;
28-
29-
// logging string "bar" at timestamp 8
30-
logger.shouldPrintMessage(8,"bar"); returns false;
31-
32-
// logging string "foo" at timestamp 10
33-
logger.shouldPrintMessage(10,"foo"); returns false;
34-
35-
// logging string "foo" at timestamp 11
36-
logger.shouldPrintMessage(11,"foo"); returns true;*/
378
public class _359 {
389

3910
public static class Solution1 {

0 commit comments

Comments
 (0)