Tag: c++
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 …
Given a string s, return true if s is a good string, or false otherwise. A string s is good if all the characters that appear in s have …
Given a list/array/vector in C++, we can iterate the elements in the reversed order using the following approaches: Traditional Way, Iterate by Index We can iterate by index, the …