I am getting SIGABRT error in my code. Can anyone tell me from where it might be coming?
Here's my code:
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int n;
        cin>>n;
        string s;
        cin>>s;
        int d=stoi(s,nullptr,2);
        int f=__builtin_popcount(d);
        cout<<f*(f-1)/2+f<<endl;
    }
}
 
     
    