Answered step by step
Verified Expert Solution
Question
00
1 Approved Answer
There is a bag of balls with different types of colours. You have to find out the Total number of different types of colors of
There is a bag of balls with different types of colours. You have to find out the Total number of different types of colors of ball present in the bags. Bag of balls will be represented as an array A containing integers Ai Different values of Ai represents different colors. Example : There is a bag containing the following balls : Now the types of colors present in the bags are so the number of Types of colours are so answer is Example : There is a bag containing the following balls : Now the types of colors present in the bags are so the number of Types of colours are so answer is Input Format The first line will contain an integer n which is the length of array A The second line will contain n space seperated integers representing the elements of array A Constraints n Ai Output Format Print a single line containing the integer representing the numbers of colors of balls present in the bag. Sample Input Sample Output Explanation The different types of colors present in the array are so there are only types of colors.
There is a bag of balls with different types of colours. You have to find out the Total number of different types of colors of ball present in the bags. Bag of balls will be represented as an array A containing integers Ai Different values of Ai represents different colors. Example : There is a bag containing the following balls : Now the types of colors present in the bags are so the number of Types of colours are so answer is Example : There is a bag containing the following balls : Now the types of colors present in the bags are so the number of Types of colours are so answer is
Input Format
The first line will contain an integer n which is the length of array A The second line will contain n space seperated integers representing the elements of array A
Constraints
n Ai
Output Format
Print a single line containing the integer representing the numbers of colors of balls present in the bag.
Sample Input
Sample Output
Explanation
The different types of colors present in the array are so there are only types of colors.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered 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