Queen's Attack II Discussions | Algorithms | HackerRank
  • + 0 comments
    for row in [-1,0,1]:
    	for col in [-1,0,1]:
    		if row == 0 && col == 0:
    			continue
    

    there are 8 directions, 8 is 9-1 :)