made by Jaehyeok Choi
dynamic programming
I tried to do it with recursion. Saving the minimal value location and adding the minimal value. Recalculate total cost if minimal value location is same as previouse value, back track until I find the answer.
I think this might be wrong because of the time limitation and there should be better solution. So I tried to save all the optimal cases because there is only 3 options I can take (RGB).
In addition, I cannot take the same color which I take in the previous building. It means compare other 2 cases and additing them with current take value will be the answer.
You can contact me through email, which is [email protected]. Thank you for visiting this github!