I think the testcases to this problem in hackerblocks aren’t correct.Can you correct me if I am wrong.My code is on the above link
Painter's partition problem in hackerblocks
You cannot sort the boards because their order will change. Try without sorting and apply binary search.