You have been asked to help study the population of birds migrating across the continent. Each type of bird you are interested in will be identified by an integer value. Each time a particular kind of bird is spotted, its id number will be added to your array of sightings. You would like to be able to find out which type of bird is most common given a list of sightings. Your task is to print the type number of that bird and if two or more types of birds are equally common, choose the type with the smallest ID number. For example, assume your bird sightings are of types . There are two each of types and , and one sighting of type . Pick the lower of the two types seen twice: type . Function Description Complete the migratoryBirds function in the editor below. It should return the lowest type number of the most frequently sighted bird. migratoryBirds has the following parameter(s): arr : an array of integers representing types of birds sight...
Given a string, , consisting of alphabets and digits, find the frequency of each digit in the given string. Input Format The first line contains a string, which is the given number. Constraints Given a string, , consisting of alphabets and digits, find the frequency of each digit in the given string. Input Format The first line contains a string, which is the given number. Constraints All the elements of num are made of english alphabets and digits. . Output Format Print ten space-separated integers in a single line denoting the frequency of each digit from to . Sample Input 0 a11472o5t6 Sample Output 0 0 2 1 0 1 1 1 1 0 0 Explanation 0 In the given string: occurs two times. and occur one time each. The remaining digits and don't occur at all. Sample Input 1 lw4n88j12n1 Sample Output 1 0 2 1 0 1 0 0 0 2 0 Sample Input 2 1v88886l256338ar0ekk Sample Output 2 1 1 1 2 0 1 2 0 5 0 #include<stdio.h>...
Comments
Post a Comment
If you have any doubt you ask me in comment section