Problem 2: Number of runs 50 pts Given an integer array, implement a static method num0fRuns (int[] arr) in Runs.java, t
Posted: Fri Jul 08, 2022 7:26 am
Test Driver: TestRuns 1 import java.util.Scanner; 3 public class TestRuns { 4567AENT 2 8 9 10 11 12 13 14 15 16 17 } public static void main(String[] args) { Scanner stdin = new Scanner(System.in); int num = stdin.nextInt(); int[] arr = new int[num]; for (int i arr } } = = 0; i < num; i++) { stdin.nextInt(); System.out.println(Runs.num0fRuns (arr)); stdin.close();
Test Case Information Title Input Output(LHS) vs Expected(RHS) test1 4 1 2 2 1 12 2 1 2 2
Test Case Information Title Input Output(LHS) VS Expected (RHS) test2 5 1 2 3 4 5 1 1 2 11 2