FastPrepCount Strict Grid Maxima
Problems/Count Strict Grid Maxima

Count Strict Grid Maxima

Intuit logoIntuit● EasyINTERNOA

Updated Oct 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The source describes maxima against four neighboring cells. Boundary comparisons and single-cell behavior are practice assumptions; about 90% match.

Count cells whose value is strictly greater than every existing orthogonal neighbor (up, down, left, right). Diagonal cells are not neighbors. At the boundary compare only neighbors inside the grid. A one-cell grid therefore has one maximum.

Function

countMaxima(grid: int[][]) → int

Examples

Example 1

grid = [[1,4,1],[3,2,5]]return = 3
grid
01201411325

The cells with values 4,3,5 exceed each of their orthogonal neighbors.

Example 2

grid = [[7]]return = 1
grid
007

There are no existing neighbors to disqualify the only cell.

Constraints

  • For this exercise, assume a nonempty rectangular grid with at most 200000 cells; each value is a signed 32-bit integer.

More Intuit Online Assessment questions

  • Employee Promotion OpportunitiesOA · Seen Oct 2026
  • Next Pascal Row CoefficientOA · Seen Oct 2026
  • Parse Router LogsOA · Seen Oct 2026
  • Longest Repeated Letter Block with Adjacent SwapsOA · Seen Oct 2026
  • Maximum Square-Free DivisorOA · Seen Oct 2026
  • Two Tribes from Taller-Person CountsOA · Seen Oct 2026
  • Shortest Path from an Encoded GraphOA · Seen Sep 2026
  • Oldest and Youngest EmployeesOA · Seen Sep 2026
  • Pressure-Isolation Shutdown OrderOA · Seen Sep 2026
  • Submask Sum QueriesOA · Seen Sep 2026

Similar questions at other companies

  • Survey Table: Group Given an AnswerSusquehanna International Group (SIG) · OASusquehanna International Group (SIG) interview questions
  • Wind-Blown Leaves Remaining in a GridAbridge · OAAbridge interview questions
  • Query a Header-Encoded MatrixNVIDIA · OANVIDIA interview questions
  • Trapped Characters in a GridAdobe · OAAdobe interview questions
  • Center Crop a Grayscale ImageLuma AI · OALuma AI interview questions
  • Find Zero Cells in a 2×2 GridRoblox · OARoblox interview questions
  • Make Pixel Columns Strictly IncreasingMicrosoft · OAMicrosoft interview questions
  • Count Pieces After Othello MovesHudson River Trading · OAHudson River Trading interview questions
  • Tic-Tac-Toe Board StatusPinecone · OA
  • Cherry PickupInfosys · OAInfosys interview questions

Interview reports that mention this question

  • Intuit OA: What It Tests (2026)

Intuit interview experiences

  • Intuit Software Engineering Intern - Full Stack OA Format
All Intuit interview questionsSee Intuit hiring insights
Saved
class Solution {
    public int countMaxima(int[][] grid) {
        // Write your code here
    }
}
Checking account…