How the state like dp( i ) such that min colors to change till position i fails in this case ? like how to decide that we need L - R dp state and not only dp ( L ) or dp( R )?
Regarding DP state ( Flood Fill )
@Vishal_234 hey ctually it depens on condition of question ,like in this question suppose we have 4 1 4 so our answer depend on two factor like l and r that is 4 and 4 or it depend on interval basically so we have to consider both the terms,if you consider only one term then it will not be solved,means you have to see the no of factors on which current state of dp depend.
1 Like
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.