Kumi Labs Interview Question

Knight move problem related to data structures.