Answer: SAFRAN Hiring Challenge | Online Assessment Question | On-Campus (2024)
Answer · Posted Jun 2026
Approach Use a HashMap to track how many times each number has already appeared. For every number: Get its current frequency. If the frequency equals the number of existing rows, create a new row. Place the number into the row corresponding to its frequency. Increase its frequency. This ensures: No duplicate exists in a row. The minimum number of rows is created. Strategy Create an empty 2D list. Maintain a frequency map for each number. Traverse the array: Find how ...
The full answer & interview discussion are available to premium members.
Log in Create a free account