Hackerrank Angry Professor Solution

The below program is the solution of Angry Professor in Implementation sub-domain. You can get the question HERE.

Output :


Code :


#include<iostream>
using namespace std;

int main()
{
    int t,x,y,c=0,m;
    cin>>t;
    while(t--)
    {
        cin>>x>>y;
        while(x--)
        {
            cin>>m;
            if(m<=0)
                c++;
        }
        if(c>=y)
            cout<<"NO"<<endl;
        else
            cout<<"YES"<<endl;
        c=0;
    }
    return 0;
}

Comments

Popular posts from this blog

Non Restoring Division Algorithm Implementation in C

Bit Stuffing Code Implementation in Java

Hackerrank Modified Kaprekar Numbers Solution