Dynamic Programming, Facebook Coding Interview, Google Coding Interview, Coding Interviews, Java.
p[j] == '*' false otherwise Rod cutting Input array price[] where price[i] contains price of rod of length i Dp state dp[i] represents max value we can get for rod of length i i = 1 to n dp[i] = for j in 0 to i-1 max(dp[i], price[j] + dp[i-j-1] Optimal binary search Input array frequency[] where