hasOnes

Complete the method hasOnes, which iterates through a two-dimensional array and returns true if there is at least one element in every row that has a value of 1.

The following are examples:

Input

1 2
3 1

Result: true

Input:

1 1
3 1

Result: true

Input:

1 1
3 0

Result: false (the 2nd row does not contain a 1)

 

Type your solution        
Skills Practiced:
3.C
3.E
4.A
4.B
Copyright © StudyCS 2024 All rights reserved.