Size of parts

Report a typo

A detecting device compares the size of components produced by a machine against the reference component.

If the size of the component is larger, it can be fixed; the detector prints 1.
If the size of the component is smaller, it is deemed as a rejection; the detector prints -1.
If the component is perfect, it is sent to the box; the detector prints 0.

Write a program which takes n (the number of parts) as input and then the detector sequence. The program should output three numbers in a single line — the number of perfect components, the number of larger components, and the number of rejections.

Sample Input 1:

10
1
1
1
0
1
-1
0
1
-1
0

Sample Output 1:

3 5 2
Write a program in Kotlin
fun main() {
// put your code here
}
___

Create a free account to access the full topic