FazeelUsmani / Amazon-SDE-Preparation

This repository includes all the interview preparation questions for Amazon SDE role
https://practice.geeksforgeeks.org/batch/Amazon-Test-Series
1.12k stars 291 forks source link

Create 05 countDistinctElements #75

Closed Juro221 closed 3 years ago

Juro221 commented 3 years ago

We count distinct elements in the first window of size K and then we do process called window sliding where we slide our window one element to the right and we update our unique elements. Time complexity : O(N)