摘要:
Classic DP. The initial intuitive O(k*n^2) solution is like this: class Solution { public: /** * @param pages: a vector of integers * @param k: an int 阅读全文
摘要:
Bucketing! A lot of details to take care.struct Bucket{ Bucket() :l(-1), r(-1), bValid(false){};int l, r; bool bValid;};class Solution {public: ... 阅读全文
摘要:
Binary search. Please not data types and some details.class Solution {public: /** *@param L: Given n pieces of wood with length L[i] *@para... 阅读全文