Is this your company?
Given a Connect4 array, write a function connect4(pieceColor, column) to judge if a winning condition is reached.
Anonymous
The way he asked the question was pretty confusing. I was not sure if I should write two functions, one for updating the board and one for judging if a winning condition is reached. I ended up doing a O(n) function for updating board, and another O(1) function to see if there is a horizontal, vertical, or diagonal connected 4 pieces. Not sure if that's right. I think it can be done by DP
Check out your Company Bowl for anonymous work chats.