Infosys SP DSE Hiring Drive 2026 | Maximize Contentment & Count Subarrays with Odd Sum

Infosys · Question · Posted Jun 2026

Problem 1 - Maximize Contentment (Candy Distribution Logic) Problem Statement You are organizing a festival for a class of students. Each student has a greed factor represented by the array greed, where greed[i] denotes the minimum candy size required to satisfy that student. You are also given an array size, where size[j] represents the size of the j-th available candy packet. A student becomes content if they receive a candy whose size is greater than or equal to their greed ...

The full answer & interview discussion are available to premium members.

Log in Create a free account