MCPcopy Create free account
hub / github.com/SAKET-SK/Programming-Aptitude-Interview-Prep / main

Method main

TCS/Que 3/Solution.java:4–23  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

2class Solution
3{
4 public static void main(String[] args)
5 {
6 Scanner sc=new Scanner(System.in);
7 int n=sc.nextInt();
8 int arr[]=new int[n];
9 for(int i=0;i<n;i++)
10 arr[i]=sc.nextInt();
11
12 int max=Integer.MIN_VALUE;
13 int count=0;
14 for(int i=0;i<n;i++)
15 {
16 if(arr[i]>max)
17 {
18 max=arr[i];
19 count++;
20 }
21 }
22 System.out.println(count);
23 }
24}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected