InMobi Interview Question for SDE-2s
- 0of 0 votes
You are a coin collector in a country, where the silver coin denominations runs from 1 to 1000000. You have N coins with you with various denominations.- poorna.chandra.akp May 19, 2014 in India
Apart from the silver coins, the country also issues gold coins which can be used as any value. With the given silver and gold coins, find out the maximum continous denomination streak you can achieve.
For example, if you have 4 silver coins of value 2, 3, 5 and 9 and 1 gold coin. You can have a maximum streak of 4 coins by using the gold coin as value 4.
The first line contains 2 integers, S and G. S is the number of silver coins you have and G is the number of gold coins you have. S lines follow, each line is the value of the corresponding silver coin
One integer, representing the maximum streak you can have using the coint.
Sample Input 1
Sample Output 1
| Report Duplicate | Flag | PURGE
Open Chat in New Window