Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Ones and Zeroes

Given binary strings and two integers m and n, print the size of the largest subset of the strings that has at most m zeros and at most n ones in total.

Constraints

1 <= k <= 600 1 <= len(string) <= 100 0 <= m, n <= 100

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.