Katkat
HR Screen

A Greedy Deletion Problem on a String of 1s and 2s

DRWSoftware Engineer · New Grad · HR Screen · Aug 2026

I got a string greedy problem: Given a string digits made up only of '1' and '2', which represents a positive integer. You can delete 0 or more characters from it, and after the deletion: the number of remaining '1's must be even; the number of remaining '2's must also be even; and, while satisfying those first two conditions, the final integer should be as large as possible. Note that you can on…

Shared by a candidate · reported Aug 2026. Interview formats change; use it as a guide, not a script.