</>OfferRetriever
DashboardDiscuss
NEW

Summer Sale

Limited Time Deal: Unlock all premium questions for over 30% off

$10.42$7.08

14

:

03

:

44

:

07

Get this deal
Back to Dashboard

Color Chain Winner

Medium
FREE

You are implementing a color chain game. Two players take turns placing tokens on a grid. Each cell contains "red", "blue", or "" (empty). A player wins when they form a chain of 4 or more consecutive tokens of their color in a row, column, or diagonal.

Given the current board state (before the move), the position [row, col] where the current player places their token, and the player's color, place the token and check if the placement creates a chain of 4 or more. Return the winning player's color if they win, or "" if no win occurs. ...

OfferRetriever

Master technical interviews with real questions from top companies. Build your confidence and career.

PRODUCT
PricingDashboardDiscussOfferRetriever vs LeetCode
LEGAL
POPULAR COMPANIES
GoogleMetaAmazonMicrosoftNetflixStripeUberTikTokBrowse all companies →

© 2026 Purple Business Holdings LLC. All rights reserved. See Terms of Service.