Bloomberg Online Java Interview Question
Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2021-02-08Added By Anonymous
Source: Link
Company: Bloomberg
Role: unknown
Stage: Online Interview
Location: unknown
Year: unknown
Original Post:
Write a function that prints out the minimum number of coins recquired to add up to the number of cents passed in. You may dispense any number of 1c, 5c,10c,25c coins to make up the minimum. for eg: 12 -> "1x 10c, 2x 1c" 132 -> "5x 25c, 1x 5c, 2x 1c" 68 -> "2x 25c, 1x 10c, 1x 5c, 3x 1c" Provide optimal java solution.
Role: unknown
Stage: Online Interview
Location: unknown
Year: unknown
Original Post:
Write a function that prints out the minimum number of coins recquired to add up to the number of cents passed in. You may dispense any number of 1c, 5c,10c,25c coins to make up the minimum. for eg: 12 -> "1x 10c, 2x 1c" 132 -> "5x 25c, 1x 5c, 2x 1c" 68 -> "2x 25c, 1x 10c, 1x 5c, 3x 1c" Provide optimal java solution.