← Amazon questions

Max size of generated set from array mapping

Filed under Amazon

For a given array 'a' of size n, create sets of elements by repeatedly following indices: a[i], a[a[i]], a[a[a[i]]], etc., for each starting index i from 0 to n-1. Find the maximum size among all such…

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 Amazon questions

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