Amazon Interview Question
Software Engineer in TestsMaybe you should also validate whether there is a piece(his own or opposite) at that position. If so, reture false.
if knight is securing king i.e knight is in between king and opponents power then you cant move knight... if you move the knight then king will be under check mate, so that move is invalid...
- Anonymous December 27, 2010