ATM Notes Breakdown

JavaScript Medium 5 views
Back to Questions

Problem Description

Given amount, break it into notes of 2000,500,200,100,50,20,10 using greedy. Print counts in same order. If amount is not multiple of 10 or negative, print -1.

Input Format

One integer amount.

Output Format

7 integers counts or -1.

Sample Test Case

Input:
2890
Output:
1 1 1 1 1 2 4

Constraints

0

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next