Learning Output
Basic Accuracy: 0.0% Submissions: 0 Points: 1

Being a Programmer you have to learn how to make your output looks better. According to the company, its company programmers have to present its output in a different manner as: If your output is 10.000000 you can save the decimal places and thus your output becomes 10. Now u have the learn the way to output.  You are given elements of an array A[N] and you have to divide N by total no. of +ve integers, N by total no. of -ve integers, and N by total no. of zero value integers.


Example 1:

Input : 
N = 10
A[] = {7, 7, 7, 7, 7, 7, -9, -9, -9, 0}

Output : 

Explanation :
Positive count = 6, therefore 10/6 = 1.66667
Negative count = 3, therefore 10/3 = 3.33333
Zero's count = 1, therefore 10/1 = 10


Your Task:  
You don't need to read input or print anything. Your task is to complete the function Learning() which takes the array A[], its size N, pos, neg and zero as inputs and stores the answers in the reference variables pos, neg and zero the following:-
N by Total no. of +ve integers
N by Total no. of -ve integers
N by Total no. of zero value integers

Expected Time Complexity: O(N)
Expected Auxiliary Space: O(1)

Constraints :
1 ≤ N ≤ 105
-105 ≤ A[i] ≤ 105

to report an issue on this page.


We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?


All Submissions

My Submissions:

Login to access your submissions.

Learning Output

Output Window