Goki and his breakup

Goki recently had a breakup, so he wants to have some more friends in his life. Goki has N people who he can be friends with, so he decides to choose among them according to their skills set Yi(1<=i<=n). He wants at least X skills in his friends.

Help Goki find his friends.

Example:

Input:  n = 5, x = 100, arr = [110,130,90,100,45]

Output

YES YES NO YES NO

Approach

C++

#include <bits/stdc++.h>
using namespace std;

void gokiBreakup(int nint xint arr[])
{
    for (int i = 0i < ni++)
    {
        int y = arr[i];
        if (y >= x)
            cout << "YES\n";
        else
            cout << "NO\n";
    }
}
int main()
{
    int n = 5;
    int x = 100;
    int arr[] = {1101309010045};

    gokiBreakup(nxarr);

    return 0;
}


No comments:

Post a Comment