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.
unable to pass 4 test cases any help in logic would be appriciated
# Enter your code here. Read input from STDIN. Print output to STDOUTimportitertoolsk_n_list=input().split()#takeK,Masinputnumber=int(k_n_list[0])#gettingnumberofKnew_list=[]#emptylistfind_element=[]#emptylisttostoreallpossiblesquaredmodulooperatedvalueforiinrange(0,number):#forloopforappendingthenumberofinputedlistnew_list.append(input().split())#nestedlistoflistscombinations=list(itertools.product(*new_list))#allpossiblevaluesofthenestedlist# it dose not conatain the same element from the list forcombincombinations:#squareandmodulooperationinthisloopb=list((map(int,comb)))out=sum(map(lambdai:i*i,b))%int(k_n_list[1])find_element.append(out)print(max(find_element))
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Maximize It!
You are viewing a single comment's thread. Return to all comments →
unable to pass 4 test cases any help in logic would be appriciated