Answer to Question #226870 in Python for jayanth

Question #226870

a company is planning a big sale at which they will give their customers a special promotional discount. each customer that purchases a product from the company has a unique customer id numbered from 0 to n-1.

1.andy, the marketing head of the company, has selected bill amounts of the n customers for the promotional scheme. the discount will be given to the customers whose bill amounts are perfect squares. the customers may use this discount on a future purchase. write an algorithm to help andy find the number of customers that will be given discounts?


1
Expert's answer
2021-08-17T12:52:57-0400
Input:
N = number of customers having bills that are chosen for promotional discount
Space-separated numbers representing the total number of bill amount of the customers.
Output:
Display the number of customers that will receive the discount
Constraints:
0<=N<=10^6
0<= billi<=10^6
0<=i<N

Example
Input:
N=6
36 16 54 81 48 49
Output:
 4
Explanation: 
36, 16, 81, and 49 are the bill amounts that are perfect squares. 
Therefore, the answer is 4 because there are four numbers that are perfect squares

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS