Get rid of this line:

{package p3;}

You don't need it, and it makes the judge all moody ;)

Best,
Matt

On Monday, April 20, 2020 at 12:37:16 PM UTC-4, Moustafa Farouk wrote:
>
> Code works fine on local eclipse. Returns Runtime Error on KickStart 
> platform. Any idea?
> Round B 2020 - 1st problem:
>
> package p3;
>
> import java.io.BufferedReader;
> import java.io.InputStreamReader;
> import java.util.ArrayList;
> import java.util.List;
> import java.util.Scanner;
>
> public class Solution {
>
> public static int checkPeakPoints(int n, int[] arr) {
> int peak = 0;
> for (int i = 1; i < arr.length - 1; i++) {
> if (arr[i] > arr[i - 1] && arr[i] > arr[i + 1])
> peak++;
> }
> return peak;
> }
>
> public static void main(String[] args) {
> Scanner in = new Scanner(new BufferedReader(new 
> InputStreamReader(System.in)));
> int t = in.nextInt();
> List<int[]> x = new ArrayList<int[]>();
> for (int i = 1; i <= t; ++i) {
> int n = in.nextInt(); // number of arr
> int[] arr = new int[n];
> for (int j = 1; j <= n; j++) {
> int m = in.nextInt();
> arr[j-1] = m;
> }
> x.add(arr);
> }
> StringBuilder sb = new StringBuilder();
> for (int i = 0; i < x.size(); i++) {
> int[] arr = x.get(i);
> int sol = checkPeakPoints(arr.length, arr);
> sb.append("Case #"+(i+1)+": "+sol+"\n");
> }
> System.out.println(sb.toString());
> }
> }
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/a78522b4-9c23-4c07-9fbc-5e0b1b1ed3b4%40googlegroups.com.

Reply via email to