Difficulty in problem : LCOLLIS

can someone please tell what it wrong with my code , it is giving output as 0 in all test casses.
the link to the problem is https://www.codechef.com/LTIME37/problems/LCOLLIS/

#include<iostream>
using namespace std;
int main(){
    int t;
    cin>>t;
    while(t--){
        int n,m,i,j,p;
        int cnt=0;
        cin>>n;
        cin>>m;
        int coll[n][m];
        for(i=0;i<n;i++)
            for(j=0;j<m;j++)
                cin>>coll[i][j];
        for(i=0;i<n-1;i++)
            for(p=i+1;p<n;p++)
                 for(j=0;j<m;j++)
                {
                    if(coll[i][j]==1 && coll[p][j]==1)
                        cnt++;
                }
                cout<<cnt<<endl;
    }
    return 0;
}

You can see my code I did this

# cook your dish here
for _ in range(int(input())):
    n,m=map(int,input().split())
    l=[[0]*m for i in range(n)]
    #print(l)
    d=0
    for i in range(n):
        s=input()
        for j in range(m):
            l[i][j]=s[j]
    #print(l)
    for i in range(m):
        c=0
        for j in range(n):
            #print(l[j][i],end=" ")
            if l[j][i]=="1":
                c=c+1
        d=d+(c*(c-1))//2
    print(d)

You’re not taking input correctly. Specifically, lines 12-14. There is no space between numbers in the input. Input that as a character string instead of an integer.

thanks @aadiupadhyay

okay I got my mistake , thanks @psaini72

So I mentioned the main part for you. You can make some changes if you willing to.

for(int i=0;i<n;i++)
{
cnt=0;
for(int j=0;j<m;j++)
{
if(coll[i][j]==‘1’)
cnt++;
}
ans+=(cnt*(cnt-1))/2;
}
cout<<ans<<endl;

and one more thing, you have to declare coll as char array because it takes character input.

ok I got your approach , thank you @samfisher_2019