Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The current selected programming language is Python. We emphasize the submission of a fully working code over partially correct but efficient code. Use of certain
The current selected programming language is Python. We emphasize the submission of a fully working code over partially correct but efficient code. Use of certain header files is restricted. Once submitted, you cannot review this problenn again. You can use print to debugyour code. The print may not work in case of syntaxiruntime error. The version of Python being used is 2.7. In a school, there are activity groups. Each group has been identified by a digit from 0 to 9 . The school principal wants to find out how many students are in a particular activity group so that the school management can provide a classroom for the activity according to the number of students. Write an algorithm for the school management to get the number of students who belongs to a particular activity group. Input The first line of the input consists of an integer-particularGroup, representing the activity group whose total students the principal wants to know. The second line of input consists of an integer - studentGroup, representing the groups which are selected by the students. Output Print an integer representing the number of students who belongs to a particular activity group. Constraints 0 particularGroup $9 0 studentGroup 99999999 Note Each digit of the studentGroup represents the activity of a particular student. Example inpur: 2 123228 Output: 3 Explanation: Activity 2 is selected by 3 students. Therefore, the final output is 3
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started