← Paytm questions

Find frequency of elements from 0 to n-1 in O(n) time and O(1) space

Filed under Paytm

Given an array of length n containing elements in the range [0, n-1], count the frequency of each element using O(n) time and O(1) auxiliary space.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Paytm questions

Collected from public candidate posts and coding forums. Updated Nov 2026.