We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Java
- Data Structures
- Java Dequeue
- Discussions
Java Dequeue
Java Dequeue
Sort by
recency
|
338 Discussions
|
Please Login in order to post a comment
This is a really clear introduction to deques and their usage. I like how it shows both LinkedList and ArrayDeque implementations — it helps beginners see the options available in Java. funinexchange247
simplest logic
Set took too much time.
my solution: import java.util.*; public class test { public static void main(String[] args) { Scanner in = new Scanner(System.in); Deque deque = new ArrayDeque<>(); Set set = new HashSet<>(); int n = in.nextInt(); int m = in.nextInt(); int max = 0;