Satya interview question

dp question like sudoko solving