Meta | Google | Amazon Interview
Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2025-03-29Added By Anonymous
Source: Link
🧭 Experience: unknown
✅ Outcome: unknown
💰 Compensation: unknown
📍 Location: unknown
🏢 Company: Google
🎓 Education: unknown
🎁 Benefits: unknown
📅 Offer Date: unknown
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))
✅ Outcome: unknown
💰 Compensation: unknown
📍 Location: unknown
🏢 Company: Google
🎓 Education: unknown
🎁 Benefits: unknown
📅 Offer Date: unknown
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))