# 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] ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up