Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 628 Bytes

File metadata and controls

27 lines (20 loc) · 628 Bytes
  • Complete the function maximumToys, where maximumToys has the following parameter(s):
  • int prices[n]: the toy prices
  • int k: Mark's budget

Returns

  • int: the maximum number of toys

  • Instance format:

    • The first line contains two integers, n and k, the number of priced toys and the amount Mark has to spend.
    • The next line contains n space-separated integers prices[i]
  • Input:

        7 50
        1 12 5 111 200 1000 10
  • Output:
        4