Tag: c++
Note: I have been asked this question by a Google Recruiter in the early stage of Interview Process e.g. Screening. In C++, when you access a non-existent key in …
In C++, both list and vector are container classes provided by the Standard Template Library (STL). However, they differ in several key aspects, such as their underlying data structures, …
A set in C++ (aka std::set) is a ordered set (based on a Red-Black tree) while the unordered_set is based on a Hash Map. Implement a K-eth element for …
Given a vector, e.g. of integers, we want to apply a function to each element and transform to another vector/array. For example, we might want to return a new …
Given a list of integers nums, return the length of the longest contiguous sublist where all its elements are distinct. Constraints n ≤ 100,000 where n is the length …