Triplebyte Interview Question

Implement a program that, given a connect-4 grid ('x', 'o' or empty), computes which player (if any) has won. If rotating the board 90 degrees is a valid move, now modify the program to check who has won.

Interview Answer

Anonymous

Mar 7, 2017

This is a fairly simple array manipulation question. Rotation requires you to shuffle the array elements based on "gravity". Don't worry too much about optimizations as connect-4 boards are really small.

1