Desktop Products
Coding Problem Keys
Desktop Products
Problem Statement
A company DigiComparts manufactures 52 types of unique products for laptop and desktop computers. It manufactures 10 types of laptop products and 42 types of desktop products. Each product manufactured by the company has a unique productID from a-z and and A-Z. The laptop products have productIDs (a, i, e, o, u, A, I, E, O, U) while the rest of the productIDs are assigned to the desktop products. The company manager wishes to find the sales data for the desktop products.
Given a list of productIDs of the sales of the last N products, write an algorithm to help the manager find the productIDs of the desktop products.
Input Format
Output Format
Constraints
Example 1
Input
6Output
Explanation
Example 2
Input
9Output
Explanation
Solution
Programming Language: Python 3 Language
# Published By PKJCODERS""" productID representing the product IDs of the sales. """ def calculateDesktopProductIDs(productID): # Write your code here numOfDesktopProducts = 0 laptopProductIDs = ['a','i','e','o','u','A','I','E','O','U'] for i in productID: if i not in laptopProductIDs: numOfDesktopProducts += 1 return numOfDesktopProducts def main(): # input for productID productID = [] productID_size = int(input()) productID = list(map(str,input().split())) result = calculateDesktopProductIDs(productID) print(result) if __name__ == "__main__": main()
(Note: Incase If the code doesn't Pass the output kindly comment us with your feedback to help us improvise.)
Comments