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.
- Prepare
- Algorithms
- Dynamic Programming
- Fair Cut
- Discussions
Fair Cut
Fair Cut
Sort by
recency
|
39 Discussions
|
Please Login in order to post a comment
Python Solution
C++ Solution
Here's what worked for me:
hard tedious question. the I that minimize unfairness is actually fixed, location depends on parity of n and k. proof is very long and tedious
very fast O(n) method, except for the sort(arr.begin(), arr.end()) which is O(nlog n), the rest of algo is linear time O(n)
Here is my solution in java, javascript, python, C, C++, Csharp HackerRank Fair Cut Problem Solution