In this problem, you are given a matrix of positive integers. Your task is to identify and return all rows in the matrix that are "similar" to the first row. Rows are considered similar if the sequence of non-zero elements in both rows is the same, and only zeros (which appear at the end of the row) can differ.
To be similar:
  1. The rows must share the same non-zero numbers in the same order.
  2. The zeros can be ignored but should be at the end of the row.

Solution Stats

210 Solutions

5 Solvers

Last Solution submitted on Nov 09, 2025

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers5

Suggested Problems

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!