• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests
May 23, 2023 |2.2K Views
Find the row with maximum number of 1's
  Share  1 Like
Description
Discussion

In this video, we will discuss the problem in which we are given a boolean 2D array, where each row is sorted. We have to find row with maximum number of 1's. 

Example:  

Input matrix :  0 1 1 1
                         0 0 1 1
                         1 1 1 1  // this row has maximum 1s
                         0 0 0 0
Output: 2

We will discuss different ways to solve the problem from naive to optimised approach. Try it out yourself first, before going through the video solution. All the best!!!

Practice Problem: https://practice.geeksforgeeks.org/problems/maximum-no-of-1s-row3027/1
Article: https://www.geeksforgeeks.org/find-the-row-with-maximum-number-1s/
SDE Sheet: https://www.geeksforgeeks.org/sde-sheet-a-complete-guide-for-sde-preparation/

Read More