NEC Corporation interview question

chess problem.