```
using namespace std;
int main()
{
long long int N;
long long int q;
int start;
int end1;
int ch;
int cnt=0;
cin>>N;
int coins[N]={0};
cin>>q;
while(q--)
{
cin>>ch>>start>>end1;
if(ch==0)
{
for(int i=start;i<=end1;i++)
{
coins[i]=1;
}
}
else if(ch==1)
{
for(int i=start;i<=end1;i++)
{
if(coins[i]==1)
{
cnt++;
}
}
cout<<cnt<<endl;
}
else
break;
}
return 0;
}
```

im getting TLE pls help what shouldi do ?how to handle time complexity?