Skip to main content

Posts

Showing posts with the label Java Subarray Hackerrank Solution

Java Subarray Hackerrank Solution

 Java Subarray Hackerrank Solution For Explanation Check Video: Sample Input 5 1 -2 4 -5 1 Sample Output 9 Code: import  java.io.*; import  java.util.*; public   class  Solution {      public   static   void  main(String[] args) {         Scanner scn =  new  Scanner(System.in);          int  n = scn.nextInt();          int [] arr =  new   int [n];          for ( int  i= 0 ;i<n;i++){             arr[i] = scn.nextInt();         }          int  count =  0 ;          for ( int  i= 0 ;i<n;i...