COGNIZANT Hiring | Off Campus OA (2024) | Find Players With Zero or One Losses
Cognizant · Question · Posted Jun 2026
Problem Statement You are given an integer array matches where matches[i] = [winner, loser] indicates that player winner defeated player loser in a match. Your task is to identify: All players who have never lost any match. All players who have lost exactly one match. Return the answer as a list containing: [ players_with_zero_losses, players_with_one_loss ] Both lists must be sorted in increasing order. A player may participate in multiple matches, and some players may only appear as ...
The full answer & interview discussion are available to premium members.
Log in Create a free account