Given an array of tickets held by n scalpers.
The cost of a ticket at the scalper is equal to the number of tickets at a scalper at that particular moment. i.e if a 1st Scalper has 4 tickets at present then the cost of a ticket will be $4. After he sells that ticket he has 3 tickets, so the next ticket will cost $3 and so on.
If N number of tickets scalpers are seated outside a hockey stadium what is the maximum amount they can earn for the first ‘k’ tickets sold:
Input: Given n (Number of scalpers), given an array which has number of tickets held by each ticket scalper, the value of k.
Output: the max amount that can be earned by them by selling k tickets.
Solution: 5+4+3+2 =14
If you like GeeksforGeeks and would like to contribute, you can also write an article and mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
- Fiberlink (maas360) Interview Experience | Set 4 (Off-Campus)
- Fiberlink (maas360) Interview | Set 2 (Written Test Question)
- Fiberlink (maas360) Interview | Set 1
- Fiberlink (maas360) Interview | Set 3
- Fiberlink Recruitent Process
- MakeMyTrip Interview Experience | Set 5 (Online Coding)
- BrowserStack Interview Experience | Set 7 (Online Coding Questions)
- MakeMyTrip Interview Experience | Set 6 (Online Coding)
- Tesco Bengaluru Interview Experience | Set 1 (Online Coding Test)
- Microsoft Interview Experience | Set 141 (Off-Campus - Online Coding Test for IDC)
- Atlassian Online Coding Interview Experience
- GOCC14: Google's Online Coding Challenge - New Grad (India)
- GOCC14: Google Online Coding Challenge 2020 - New Grad (India)
- GOCC15: Google SWE Online Coding Challenge Internship 2021
- Google Internship 2020 - Google Online Challenge(1st Coding Round)
- GOCC18: Google Online Coding Challenge 2020 - New Grad(India)
- TCS NQT Coding Questions & How Coding Task Evaluated in TCS NQT
- Amazon Interview Experience | Set 321 (Online Assessment)
- Tesco Interview Experience | Set 2 (Online Test)
- Tesco Interview Experience | Set 3 (Online Test)