Skip to main content

Posts

Showing posts with the label Jesse and Cookies Hackerrank Solution Java

Jesse and Cookies Hackerrank Solution Java | Data Structure

 Jesse and Cookies Hackerrank Solution Java | Data Structure Note: Due to TLE i modified the some part of code. Sample Input STDIN Function ----- -------- 6 7 A[] size n = 6, k = 7 1 2 3 9 10 12 A = [1, 2, 3, 9, 10, 12] Sample Output 2 import  java.io.*; import  java.math.*; import  java.text.*; import  java.util.*; import  java.util.regex.*; public   class  Solution {      static  PriorityQueue<Integer> heap =  new  PriorityQueue<>();      /*      * Complete the cookies function below.      */      static   int  cookies( int  k) {                   int  count =  0 ;        ...