NeetCode #579LC-1958MediumGraphs
← Back to All Problems#579 · #1958 · Check if Move is Legal(检查操作是否合法)
📌 Problem Statement & Constraints
You are given an 8x8 board with
'W', 'B' and '.', and a move at (rMove, cMove) with color. The move is legal if it forms a bracket: one or more opponent pieces in a straight line, terminated by one of your own pieces, in at least one of the eight directions. Return whether the move is legal. Constraints: 0 <= rMove, cMove <= 7, color is 'W' or 'B'.🔒
Sign In to Unlock Full Solutions for All 973 Problems
Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!