For a given multi dimensional matrix and given element, find its offset from the 1st element.

Return 0, if element is not found in the matrix.

If the element is repeated in the matrix, then return the offset of its first occurrence in the matrix.

E.g. M(:,:,1) = [1 2 3; 4 5 6] M(:,:,2) = [10 20 30; 40 50 60]

Element is 50, then its offset = 10

Solution Stats

104 Solutions

43 Solvers

Last Solution submitted on Jan 04, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...