@@ -0,0 +1,1255 @@
+import java.io.BufferedReader;%0Aimport java.io.IOException;%0Aimport java.io.InputStreamReader;%0Aimport java.util.Arrays;%0A%0A// https://www.hackerrank.com/challenges/mark-and-toys/problem%0Apublic class MarkAndToys %7B%0A%0A  private static final String SPACE = %22 %22;%0A%0A  private static long getBudget(BufferedReader reader) throws IOException %7B%0A    String%5B%5D split = reader.readLine().split(SPACE);%0A    return Long.parseLong(split%5B1%5D);%0A  %7D%0A%0A  private static long%5B%5D getPrices(BufferedReader reader) throws IOException %7B%0A    String%5B%5D split = reader.readLine().split(SPACE);%0A    return Arrays.stream(split).mapToLong(Long::parseLong).toArray();%0A  %7D%0A%0A  private static int getMaxToys(long%5B%5D sortedPrices, long budget) %7B%0A    int toys = 0;%0A    long toPay = 0;%0A    for (long price : sortedPrices) %7B%0A      if (toPay + price %3E budget) %7B%0A        break;%0A      %7D%0A      toPay += price;%0A      toys += 1;%0A    %7D%0A    return toys;%0A  %7D%0A%0A  public static void main(String%5B%5D args) throws IOException %7B%0A    try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) %7B%0A      long budget  = getBudget(reader);%0A      long%5B%5D prices = getPrices(reader);%0A      Arrays.sort(prices);%0A      int maxToys = getMaxToys(prices, budget);%0A      System.out.println(maxToys);%0A    %7D%0A  %7D%0A%7D%0A

Add solution for Mark and toys problem.