cswork / OAOpen practice workspace

Valkyrie TradingOA #1

Largest Black Subsquare Anchored at Top-Left

Estimated EasyStatement and editorial — judging is being prepared

Topics (AI-labelled)SimulationIn-place Arrays

Given a square matrix of pixel colors (B and W), find the largest subsquare anchored at the top-left corner with all four borders filled with black pixels. Return three values: the row, column of the top-left corner, and the side length. If no such subsquare exists, the side length is 0.

Examples:

  • ["BBB","B B","BBB"] → "0 0 3"

Editorial

Loading solution…