You are viewing a single comment's thread. Return to all comments →
could anyone give me some hints how to approach this, I submitted 2 approaches using Scala and both timeouted from fifth test-case.
I tried iterating through combinations but it did not work.
I implement a func f(A,B)(k, threshold) which calculate the smallest sum of k people's appeti. by maintaining min-heap of size k, and binary search from 1 to N