add code for max profit 3
add code for candy