We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
check&verify,responce there are some testcases not work
longwinningLotteryTicket(inttickets_count,char**tickets){int*bitmasks=calloc(tickets_count,sizeof(int));//int len;intcnt=0;for(inti=0;i<tickets_count;++i)for(intj=0,len=strlen(tickets[i]);j<len;++j)bitmasks[i]|=1<<(tickets[i][j]-'0');// set n-th bit to 1for(inti=0;i<tickets_count;++i)for(intj=i+1;j<tickets_count;++j)if((bitmasks[i]|bitmasks[j])==1023)++cnt;returncnt;}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Winning Lottery Ticket
You are viewing a single comment's thread. Return to all comments →
check&verify,responce there are some testcases not work