Given a two-dimensional boolean array with each row sorted. There are m rows and n columns in the matrix. Find the row that has the most 1s in it.
Given a two-dimensional boolean array with each row sorted. There are m rows and n columns in the matrix. Find the row that has the most 1s in it.
题目类型: 技术面试题
这是一道技术面试题,常见于澳洲IT公司面试中。
难度: easy
标签: interviewbit, deloitte, company-specific
目标公司: Deloitte
参考答案摘要
Brute force method: An easy way is to traverse the matrix row by row, counting the amount of 1s in each row, and comparing the count to the maximum. Finally, with a maximum of 1s, return the index of ...
本题提供 STAR 原则详细解答和技术解析,登录匠人学院学习中心即可查看完整答案。