Equal Row and Column Pairs at DE Shaw

Medium70.8% acceptance

This problem has 75.0% frequency at DE Shaw.

Problem Description

Given a **0-indexed** `n x n` integer matrix `grid`, _return the number of pairs_`(ri, cj)`_such that row_`ri` _and column_`cj` _are equal_. A row and column pair is considered equal if they contain the same elements in the same order (i.e., an equal array).

Read full problem and hints

Topics

Also asked at 5 companies


More DE Shaw Questions

View all DE Shaw questions