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.
I had the same way of thinking as you :) ! But, instead of re-reversing arrays, I just did append all sums to a list ([1,2,3,5,8,2,5,9,1,5,6,7]) and I found the value with maximum occurences in it. The maximum value is the only one that occurs in those 3 arrays.
max(list, key = list.count) , returns 5 !
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Equal Stacks
You are viewing a single comment's thread. Return to all comments →
I had the same way of thinking as you :) ! But, instead of re-reversing arrays, I just did append all sums to a list ([1,2,3,5,8,2,5,9,1,5,6,7]) and I found the value with maximum occurences in it. The maximum value is the only one that occurs in those 3 arrays.
max(list, key = list.count) , returns 5 !