Straightforward array problem, at first I wanted to use a frequency vector array (in C++) to solve this but I realized that wouldn’t be the best approach as the size of the vector would have been huge and that wouldn’t be very memory efficient.

Instead I decided to use an unordered set in C++ which solved that issue and was quite good for this

Solution Link: https://github.com/LaZeAsh/competitive-programming/tree/main/Leetcode/cpp/217-Contains-Duplicate

Reflection

I think I figured out how to solve this problem pretty quick, if this was python I’d be able to write the solution without the help of google but since I am learning C++ this took some help of google.

Very easy problem as I have done problems of this sort before