Geography, asked by itzbeautyangel, 7 months ago

pls answer it fast pls friends​

Attachments:

Answers

Answered by bhavikasotiya
2

Answer:

THE MAP IS NOT CLEAR SISO PLSS REPOST NAD ZOOM IT

Answered by Anonymous
2

Answer:

Mai yaad hoon kya?...... bohot dinn hogaya bath krke... xd

Explanation:

import java.io.*;

import java.util.*;

import java.text.*;

import java.math.*;

import java.util.regex.*;

public class Solution {

public static void main(String[] args) {

Scanner scan = new Scanner(System.in);

int len = scan.nextInt();

int target = scan.nextInt();

int[] arr = new int[len];

for (int i = 0; i < len; i++) {

arr[i] = scan.nextInt();

}

Arrays.sort(arr);

int sum=0,count=0;

for (int i = 0; i < arr.length; i++) {

if(sum <= target){

sum += arr[i];

count++;

}

}

System.out.println(count-1);

}

}

Similar questions