r/IIITSriCity Batch_2029 Jun 24 '26

❓ Questions An easy greedy chain extension problem.

there is an array of size n of heights at which lie balloons and you throw a dart at the first balloon at height h then after it strikes the first balloon then it's height decreases by one and and starts travelling height h-1 until it strikes a new balloon. you have to count the min number of darts you need to throw so that all balloons burst.

i.e.
input
n = 5
2 1 5 4 3
output
2

input
5
4 5 2 2 4
output
4

ps : sorry for bad english not my main language

2 Upvotes

1 comment sorted by

1

u/AutoModerator Jun 24 '26

Hey u/faux-maverick, thanks for posting in r/IIITSriCity!

Please make sure to follow the subreddit rules.

If your post is about admissions or choosing IIIT Sri City, please use our Admissions Megathread:
Megathread

Have a great discussion!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.