---
title: "Discussion on \"Row with max 1s — POTD\" | Hashnode"
description: "Discussion on \"Row with max 1s — POTD\". Row with max 1s\nGiven a boolean 2D array, consisting of only 1’s and 0’s, where each row is sorted. Return the 0-based index of the first row that has the most number of 1s. If no such row exists, return -1.\nExamples:\nInput: arr[][] = [[0, 1, 1, 1],\n..."
url: "https://hashnode.com/posts/row-with-max-1s-potd/66a72390a22f515987d3d07a"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Row with max 1s — POTD](https://keycomputereducation.hashnode.dev/row-with-max-1s-potd?utm_source=hashnode&utm_medium=feed)

Row with max 1s Given a boolean 2D array, consisting of only 1’s and 0’s, where each row is sorted. Return the 0-based index of the first row that has the most number of 1s. If no such row exists, return -1. Examples: Input: arr\[\]\[\] = \[\[0, 1, 1, 1\], ...

Jul 29, 2024 · 2 min read · keycomputereducation.hashnode.dev  
Read the article

-   [#algorithms](https://hashnode.com/tag/algorithms)
-   [#data-structures](https://hashnode.com/tag/data-structures)
-   [#cpp](https://hashnode.com/tag/cpp)
-   [#java](https://hashnode.com/tag/java)
-   [#python](https://hashnode.com/tag/python)
-   [#geeksforgeeks](https://hashnode.com/tag/geeksforgeeks)
-   [#programming-blogs](https://hashnode.com/tag/programming-blogs)

## Written by

[Akshima Sharma](https://hashnode.com/@Keycomputereducation)

@Keycomputereducation

  
[View profile](https://hashnode.com/@Keycomputereducation)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
