Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Go Scoreboard
Given a matrix representing a Go board with the following types: '' - empty, 'w' - white, 'b' - black, return a final score for the winner of the board. The score is just the number of cells that make up its outer shell. Keep in mind, if a structure is surrounded on all sides by the opposite color, its points are forfeit. Follow-up: for the white side, write a function that returns the single empty cell '' that the player should add a 'w' to in order to increase their score the most.
Asked at:
Meta
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Mid August, 2024
Meta
Senior
Given a matrix representing a go board with the following types: '' - empty 'w' - white 'b' - black return a final score for the winner of the board. The score is just the number of cell that make up its outer shell. Keep in mind, if a structure is surrounded on all sides by the opposite color, its point are forfeit. Followup: for the white side, write a function that returns the single empty cell '' that the player should add a 'w' to in order to increase their score the most.
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.