Company: Mthree _23feb

Difficulty: medium

Problem Statement

Candy pairs Problem Description A shop stocks candies of several brands, each sold in two sizes. In the string `candies`, an uppercase letter marks a large candy of that brand and the matching lowercase letter marks a small candy of the same brand. Brands rank alphabetically, so a later letter, say C compared with B, means C is the higher-ranked brand. A brand qualifies as a "candy pair" only if the shop's stock includes at least one small and one large candy of that brand. Among all qualifying brands, you must report the highest-ranked one using its uppercase letter, or report 0 if no brand qualifies. You will receive an integer N, the number of candies in stock, and an array `candies` listing each candy as a single letter, lowercase for small and uppercase for large. Report the uppercase letter of the top-ranked qualifying brand, or 0 if none exists. Function description Complete the `Solve()` function. This function takes the following 2 arguments and returns the answer: `N`: Repres

More Mthree _23feb OA questionsInterview experiences