Solve Leetcode Problems and Get Offers From Your Dream Companies
Published in
3 min readJan 25, 2021
Problem 1429. First Unique Number.
In this series, I am going to solve Leetcode medium problems live with my friend, which you can see on our youtube channel, Today we will do Problem Problem 1429. First Unique Number.
A little bit about me, I have offers from Uber India and Amazon India in the past, and I am currently working for Booking.com in Amsterdam.
Motivation to Learn Algorithms
Problem Statement
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 in the queue.int showFirstUnique()
returns the value of the first unique integer of the queue, and returns -1 if there is no such integer.void add(int value)
insert value to the queue.