Problem 2158. Largest territory
Determine whose territory is largest. If there are multiple numbers tied for the largest territory, return the smallest number.
For example,
X = [ 1 1 2 2 1 1 2 2 2 2 2 2 ]
y = 2
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers108
Suggested Problems
-
Given an unsigned integer x, find the largest y by rearranging the bits in x
1970 Solvers
-
534 Solvers
-
Getting the indices from a vector
11669 Solvers
-
Sum the numbers on the main diagonal
609 Solvers
-
Replace Nonzero Numbers with 1
440 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!