Skip to main content
All Questions

Count how many students pass the exam based on their answer sheets.

Unlock detailed company stats for this questionUpgrade

Answer sheets are stored in an integer array A; each digit of A[i] is one answer. A student passes if (1) the sum of the digits in the sheet is greater than the smallest digit in integer M, and (2) no digit of the sheet appears in M. Return the number of students who passed. Inputs: N (number of students), M, and array A. Example: N=3, M=7777, A=[909, 3347, 1211] -> 1. Example 2: N=5, M=7723, A=[9302, 1001, 2, 56, 6] -> 2.

Format · Cognizant GenC Python cluster assessment, Dec 2025.

Community answers

No answers contributed by the community yet.

Related courses

Course

Software Engineering Interview Prep

Land your dream software engineering role at Google, Amazon, Microsoft, Meta, Apple, and other top companies. Learn from mock interviews, frameworks, and advice from senior candidates—practice data structures, algorithms, system design, people management, behavioral interviews, and more.

Course

System Design Interviews

Learn how to answer the latest system design questions across product, infrastructure, and AI domains. Features in-depth video examples, written breakdowns, and helpful reference patterns. Watch senior engineers and managers answer these questions in mock interview videos.