Tag: data structure
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 …
You are given an immutable linked list, print out all values of each node in reverse with the help of the following interface: ImmutableListNode: An interface of immutable linked …
Given a list of directory info including directory path, and all the files with contents in this directory, you need to find out all the groups of duplicate files …
Let’s say we want to implement a C++ function based on STL containers to check if a given string contains duplicate characters, or a given vector/array contains duplicate elements. …
A queue is a first-in-first-out (FIFO) data structure. We all know that the list/array in Python is very powerful, that it can be used as a queue itself. For …