GRAB Hiring Challenge | Off-Campus OA (2022) | Minimum Rounds to Complete All Tasks
Question · Posted Jun 2026
Problem Statement You are given an integer array tasks where each element represents the difficulty level of a task. In one round, you can complete either: Exactly 2 tasks of the same difficulty, or Exactly 3 tasks of the same difficulty. Your goal is to complete all tasks using the minimum number of rounds. If it is impossible to complete all tasks under the given rules, return -1. Example 1 Input tasks = [2,3,3] Output 4 Explanation Difficulty 2 → ...
The full answer & interview discussion are available to premium members.
Log in Create a free account