Citrix System Inc Interview Question for Software Engineer / Developers
- 0of 0 votes
The idea is their are "ticket stalls" with a certain number of tickets, say 9. Any ticket they sell is priced at the number of tickets that remain, so first ticket would be $9, second $8 etc...- email@example.com November 13, 2015 in United States
You're given two lines of data, say:
The first row contains two numbers:
The number of stalls
How many tickets are sold
The second line contains a list of how many tickets each stall has initially, so in this case stall 1 has 1 ticket, stall 5 has 5 tickets.
The problem: what is the maximum amount of money you can make selling the given number of tickets?
In this case, you sell four tickets from stall two for a price of 5 + 4 + 3 + 2 = $14
| Report Duplicate | Flag | PURGE
Citrix System Inc Software Engineer / Developer Algorithm
Open Chat in New Window