Implement a function, get_money_spent, that determines the maximum amount of money that can be spent on one keyboard and one USB drive without exceeding a given budget. The function takes in two lists of prices (for keyboards and USB drives) and a budget, and returns the maximum cost that can be achieved with the selected items.
Input/Output Requirements
Input:
keyboards: A list of integers representing the prices of keyboards.
drives: A list of integers representing the prices of USB drives.
budget: An integer representing the maximum allowable spending.
Output:
Returns an integer representing the maximum amount spent on a keyboard and a USB drive within the budget. If no combination can be purchased without exceeding the budget, return -1.
Example:
python
get_money_spent([40, 50, 60], [5, 8, 12], 60) # Should return 58
get_money_spent([40], [50], 30) # Should return -1
Implementation
Write the solution in a file named /app/solution.py.