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.
funcdivisibleSumPairs(nint32,kint32,ar[]int32)int32{// Write your code herevararr[][]int32=[][]int32{}forx:=rangear{fory:=x+1;y<len(ar);y++{s:=[]int32{}if(ar[x]+ar[y])%k==0{s=append(s,ar[x])s=append(s,ar[y])}iflen(s)>0{arr=append(arr,s)fmt.Println(x,arr)}}}returnint32(len(arr))}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Divisible Sum Pairs
You are viewing a single comment's thread. Return to all comments →
Go lang solution