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.
My logic is : The obvious part : If the sum is odd then its NO.
When the sum is even : There are going to be even number of odd numbers. We have to neutralise each odd numbers in pairs.
So there is a hidden sequence :
When the odd numbers are next to each other(3,3) it takes 2 loaves to equalise it, when the odd numbers are 1 integer(3,2,3) apart it takes 4 loaves and when they are 2 integers(3,2,2,3) apart it takes 6 loaves to neutralise them.
It is in an AP sequence 2, 4 , 6 , 8 ......
So I use a+ (n-1) * d to find the number of loaves needed to neutralise.
Please do tell me if this is efficient or do suggest imporvements. Thanks !
Fair Rations
You are viewing a single comment's thread. Return to all comments →
My logic is : The obvious part : If the sum is odd then its NO.
When the sum is even : There are going to be even number of odd numbers. We have to neutralise each odd numbers in pairs. So there is a hidden sequence :
When the odd numbers are next to each other(3,3) it takes 2 loaves to equalise it, when the odd numbers are 1 integer(3,2,3) apart it takes 4 loaves and when they are 2 integers(3,2,2,3) apart it takes 6 loaves to neutralise them. It is in an AP sequence 2, 4 , 6 , 8 ......
So I use a+ (n-1) * d to find the number of loaves needed to neutralise. Please do tell me if this is efficient or do suggest imporvements. Thanks !