Meta | Google | Amazon Interview
455
Mar 29, 2025
BattleShip Problem
Given the postions of the ships, height and width of the board, determine if it is a valid board or not.
Rules are:
1.No two pieces can be overlapping
2.It can't be touched by its corners and edges
3.Pieces can't be out of bound , can be placed only horizontally or vertically
4.The piece should be placed within the board
ship position will be represented as ((start_x, start_y), (end_x, end_y))
Comments (1)


