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
|
36 Discussions
|
Please Login in order to post a comment
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
Can someone explain why this code is not clearing all test cases: https://p.ip.fi/0EaF
Can someone explain why this code is not clearing all test cases:
include
define ll long long int
using namespace std;
ll fairCut(int k, vector arr) { int n = arr.size(); vector> dp(n+1, vector (k+1, LLONG_MAX));
}
signed main() { int n, k;
}
Here is the solution of Fair Cut Click Here