Robbie Hatley's Solutions To The Weekly Challenge #271
For those not familiar with "The Weekly Challenge", it is a weekly programming puzzle with two parts, cycling every Sunday. You can find it here: The Weekly Challenge The Weekly Challenge for the week of 2024-05-26 through 2024-06-01 is #271. Its tasks are as follows: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Task 271-1: Maximum Ones Submitted by: Mohammad Sajid Anwar You are given a m x n binary matrix. Write a script to return the row number containing maximum ones. In case of more than one row, then return smallest row number. # Example 1 input: [ [0, 1], [1, 0], ], # Expected output: 1 (Row 1 and Row 2 have the same number of ones, so return 1.) # Example 2 input: [ [0, 0, 0], [1, 0, 1], ], # Expected output: 2 (Row 2 has the maximum ones, so return 2.) # Example 3 input: [ [0, 0], [1, 1], [0, 0], ], # Expected output: 2 (Row 2 have the maximum ones, so ...