Display longest name

question–>
https://practice.geeksforgeeks.org/problems/display-longest-name/0#

code–>

#include <iostream>
#include<climits>
using namespace std;

int main() {
	//code
	int t;
	cin>>t;
	
	while(t--){
	    int n;
	    cin>>n;
	    string s[n+1];
	    cin.ignore();
	    int ans=0;
	    int maxi=INT_MIN;
	    for(int i=0;i<n;i++){
	        cin>>s[i];
	        if(maxi<=s[i].length()){
	            ans=i;
	            maxi=s[i].length();
	        }
	    }
	    cout<<s[ans]<<endl;
	}
	return 0;
}

not giving the correct answer

Hey @sheikhhaji18

      if(maxi<=(int)s[i].length()){

Return type of s[i].length is not exactly int and gfg ide sometimes give problem on that