package com.fishercoder.solutions;

import java.util.Deque;
import java.util.LinkedList;

public class _933 {
    public static class Solution1 {
        public static class RecentCounter {

            Deque<Integer> deque;

            public RecentCounter() {
                deque = new LinkedList<>();
            }

            public int ping(int t) {
                while (!deque.isEmpty() && t - deque.getFirst() > 3000) {
                    deque.removeFirst();
                }
                deque.addLast(t);
                return deque.size();
            }
        }
    }
}

@@ -83,16 +83,795 @@
 dList;%0A%0A
+/**%0A * 933. Number of Recent Calls%0A *%0A * Write a class RecentCounter to count recent requests.%0A * It has only one method: ping(int t), where t represents some time in milliseconds.%0A * Return the number of pings that have been made from 3000 milliseconds ago until now.%0A * Any ping with time in %5Bt - 3000, t%5D will count, including the current ping.%0A * It is guaranteed that every call to ping uses a strictly larger value of t than before.%0A *%0A * Example 1:%0A * Input: inputs = %5B%22RecentCounter%22,%22ping%22,%22ping%22,%22ping%22,%22ping%22%5D, inputs = %5B%5B%5D,%5B1%5D,%5B100%5D,%5B3001%5D,%5B3002%5D%5D%0A * Output: %5Bnull,1,2,3,3%5D%0A *%0A * Note:%0A * Each test case will have at most 10000 calls to ping.%0A * Each test case will call ping with strictly increasing values of t.%0A * Each call to ping will have 1 %3C= t %3C= 10%5E9.%0A * */%0A
 public c

refactor 933