Help me in solving AOCC18 problem

My issue

My code

// Update the code below to solve the problem

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

int main() 
{
	int t;
    cin >> t;
	
	while(t--)
	{
	    int N, K;
	    cin >> N >>K;
	    int height_list[N];
	    for(int i=0; i < N; i++)
	    {
	        cin >> height_list[i];
	    }
	    
	}
}

Learning course: Solve Programming problems using C++
Problem Link: CodeChef: Practical coding for everyone

The problem is actually to find the number of elements in the array greater than K, so we can just traverse the array once.


Code:

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

int main() 
{
	int t;
    cin >> t;
	
	while(t--)
	{
	    int N, K;
	    cin >> N >>K;
	    int height_list[N];
	    for(int i=0; i < N; i++)
	    {
	        cin >> height_list[i];
	    }
	    
	    int ANS = 0;
	    for (auto &H:height_list) {  //Traversing arrays
	        if(H > K) ++ANS;
	    }
	    
	    cout << ANS << endl;
	}
	return 0;
}

Thanks