bp Interview Question

a brave knight DSA problem