code with java--- how to write this
===

Given a list of 'N' coins, their values being in an array A[], return the minimum number of coins required to sum to 'S' (you can use as many coins you want). If it's not possible to sum to 'S', return -1

Sample Test Cases: 

Input #00: 
Coin denominations: { 1,3,5 } 
Required sum (S): 11 

Output #00: 
3 

Explanation: 
The minimum number of coins requires is: 3 - 5 + 5 + 1 = 11;