---
# System prepended metadata

title: 2643. Row With Maximum Ones
tags: [Leetcode, Easy]

---

# 2643. Row With Maximum Ones
###### tags: `Leetcode` `Easy`
Link: https://leetcode.com/problems/row-with-maximum-ones/description/
## Code
```python=
class Solution:
    def rowAndMaximumOnes(self, mat: List[List[int]]) -> List[int]:
        maxCnt, maxIdx = 0, 0
        for i in range(len(mat)):
            cnt = sum(mat[i])
            if cnt>maxCnt:
                maxCnt = cnt
                maxIdx = i
        return [maxIdx, maxCnt]
```