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.
Can anyone help me ! this is my code for the problem
defbestSpot(heights,store):## Write your code here.divide=(len(heights)-len(store)+1)ar=[0]*pow(divide,2)foriinrange(len(ar)):forxinrange(len(store)**2):ar[i]+=pow(heights[int(i/divide)+int(x/len(store))][i%divide+x%len(store)]-store[int(x/len(store))][x%len(store)],2)print(min(ar))print(int(ar.index(min(ar))/divide)+int((len(store)*2-1)/len(store)),ar.index(min(ar))%divide+(len(store)*2-1)%len(store))#
However, i dont know what wrong with this code, i try on paper and it is correct, but when submit, it fail
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Best spot
You are viewing a single comment's thread. Return to all comments →
Can anyone help me ! this is my code for the problem
However, i dont know what wrong with this code, i try on paper and it is correct, but when submit, it fail