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.
Hi,
when I start with sample input 1 [10,4,1,2,3,4,10,20,30,40,100,200]
it should be chosen packets with index 2,3,4,5 and values 1,2,3,4 => unfairness sum is 10,
but my code with the same input shows packets with index 1,3,4,5 and values 4,2,3,4 => sum 7.
Еven if I accept the relative difference between the value of the packages=> for example to take packets with index 0,6,8,7
with values 10,10,30,20 => unfairness sum is 70 but relative ufairness sum is 7 is still below the test output in the problem
Difference between each element is 10 times more than my first example with values 4,2,3,4 but relativly the difference between 4 elements is the same.
Where is the problem? Can I take the packeges with the same value?
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Angry Children 2
You are viewing a single comment's thread. Return to all comments →
Hi, when I start with sample input 1 [10,4,1,2,3,4,10,20,30,40,100,200] it should be chosen packets with index 2,3,4,5 and values 1,2,3,4 => unfairness sum is 10, but my code with the same input shows packets with index 1,3,4,5 and values 4,2,3,4 => sum 7. Еven if I accept the relative difference between the value of the packages=> for example to take packets with index 0,6,8,7 with values 10,10,30,20 => unfairness sum is 70 but relative ufairness sum is 7 is still below the test output in the problem Difference between each element is 10 times more than my first example with values 4,2,3,4 but relativly the difference between 4 elements is the same.
Where is the problem? Can I take the packeges with the same value?