what is wrong with my code given below ANY HELP WILL BE APPRECIATED
my code:
struct ${
int start,end;
};
bool cmp( a, b){
return (a.end<b.end);
}
class Solution{
public:
int findPlatform(int arr[], int dep[], int n)
{
$ a[n];
for(int i=0;i<n;i++) a[i].start=arr[i],a[i].end=dep[i];
sort(a,a+n,cmp);
int max_count=0,count=1;
$ flag=a[0];
for(int i=1;i<n;i++)
{
if(flag.end>=a[i].start) count++;
else
{
flag=a[i];
max_count=max(max_count,count);
count=1;
}
}
return max_count;
}
};