We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I think I did the same except I reduced one variable in use. :)
importjava.io.*;importjava.util.*;publicclassSolution{publicstaticvoidmain(String[]args){/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */Scannerin=newScanner(System.in);intt=in.nextInt();intn=0;intk=0;intcurrentInTime=0;for(inti=0;i<t;i++){n=in.nextInt();k=in.nextInt();for(intj=0;j<n;j++){if(in.nextInt()<=0){k-=1;}}if(k<=0){System.out.println("NO");}else{System.out.println("YES");}}}}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Angry Professor
You are viewing a single comment's thread. Return to all comments →
I think I did the same except I reduced one variable in use. :)