Given an array of integers, 1 ≤ a ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements that appear …
Given the head of a linked list and two integers m and n. Traverse the linked list and remove some nodes in the following way: Start with the head …
You have a browser of one tab where you start on the homepage and you can visit another url, get back in the history number of steps or move …
Implement a trie with insert, search, and startsWith methods. Example: Trie trie = new Trie(); trie.insert("apple"); trie.search("apple"); // returns true trie.search("app"); // returns false trie.startsWith("app"); // returns true trie.insert("app"); …
You have a queue of integers, you need to retrieve the first unique integer in the queue. Implement the FirstUnique class: FirstUnique(int nums) Initializes the object with the numbers …