FastPrepFirst Completed Mingo Line
Problems/First Completed Mingo Line

First Completed Mingo Line

Epic logoEpic● MediumFULLTIMENEW GRADOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The report gives the board, the order of calls, the rules for a full row, column, or main diagonal, and the pair to return for the first success. This exercise allows any board size instead of the one fixed size in the report. It also defines the pair to return when nobody wins. Our version is about 95% the same as the reported exercise.

You are given an n x n board of distinct integers and a sequence called.

Process calls from left to right. A Mingo is completed when every value in a row, a column, or the main top-left-to-bottom-right diagonal has been called.

Return [1, k] when the first Mingo appears after exactly k calls. If the full sequence produces no Mingo, return [0, called.length]. Repeated values and values absent from the board still count as calls but do not mark another cell.

Function

firstMingo(board: int[][], called: int[]) → int[]

Examples

Example 1

board = [[1,2,3],[4,5,6],[7,8,9]]called = [1,5,2,9]return = [1,4]
board
012012314562789

Calls 1, 5, and 9 complete the main diagonal on the fourth call.

Example 2

board = [[1,2],[3,4]]called = [4]return = [0,1]
board
01012134

One marked cell does not complete a row, column, or the main diagonal.

Constraints

  • 1 <= n <= 500
  • board contains distinct integers from 1 through 1000000.
  • 1 <= called.length <= 1000000

More Epic Online Assessment questions

  • Character Frequencies in First-Appearance OrderOA · Seen Sep 2026
  • Minimum Adjacent TranspositionsOA · Seen Sep 2026
  • Telephone Keypad String EncodingOA · Seen Sep 2026
  • Palindrome WordOA · Seen Sep 2024

Similar questions at other companies

  • Game of Life on a Finite and an Infinite BoardCitadel · PHONE SCREENCitadel interview questions
  • Cache Shared Image Pipeline PrefixesAnthropic · ONSITE INTERVIEWAnthropic interview questions
  • Payment Partner RoutingStripe · OAStripe interview questions
  • Bank Accounts with Balance HistoryMeta · OAMeta interview questions
  • Stacked Item and Category DiscountsPalantir · OAPalantir interview questions
  • Process Banking OperationsVercel · OA
  • Maximum Diamond SumHudson River Trading · OAHudson River Trading interview questions
  • Robot Navigation Around LasersRoblox · OARoblox interview questions
  • Apply a Reversi MoveAmazon · OA
  • Flip, Invert, and Smooth a Binary ImageAbridge · OAAbridge interview questions
All Epic interview questionsSee Epic hiring insights
Saved
class Solution {
    public int[] firstMingo(int[][] board, int[] called) {
        // Write your code here.
    }
}
Checking account…