NEC Corporation Interview Question

chess problem.