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.
Interesting analysis. Although I feel this still doesn't prove that the algorithm is optimal. It proves that following the algorithm, if a solution (a way to make all even) is possible, it will be achieved; But it doesn't prove that this will be the optimal number of loaves. Correct me if I'm wrong.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Fair Rations
You are viewing a single comment's thread. Return to all comments →
Interesting analysis. Although I feel this still doesn't prove that the algorithm is optimal. It proves that following the algorithm, if a solution (a way to make all even) is possible, it will be achieved; But it doesn't prove that this will be the optimal number of loaves. Correct me if I'm wrong.