Google-Developer-Student-Club-CCOEW / Competitive-Programming-2023-GDSC-CUMMINS-X-GDSC-MMCOE

Welcome to the Hacktoberfest 2023 Competitive-Programming Cohort for Cummins College and MMCOE students! To request issue assignment, create a pull request, providing: 1. Full Name 🧑‍🎓 2.Email 📧 3.College ID (RNO) 🔢 4.Branch of Study.📚 5. Year 📆 .The Cummins College and MMCOE students' PRs will be considered only. Thank you!
9 stars 69 forks source link

Traffic Lights #145

Closed suryaprakashpandey closed 11 months ago

suryaprakashpandey commented 1 year ago

Write code in the preferred language and attach output with it.

There is a street of length x whose positions are numbered 0,1,…,x. Initially there are no traffic lights, but n sets of traffic lights are added to the street one after another.

Your task is to calculate the length of the longest passage without traffic lights after each addition.

Input The first input line contains two integers x and n: the length of the street and the number of sets of traffic lights.

Then, the next line contains n integers p1,p2,…,pn: the position of each set of traffic lights. Each position is distinct.

Output Print the length of the longest passage without traffic lights after each addition.

Example:

Input: 8 3 3 6 2 Output: 5 3 3

51tejalhajari commented 12 months ago

can you please assign this issue to me

aditi3004 commented 11 months ago

I'm enthusiastic about contributing to this issue. May I kindly request the assignment of this issue? -Aditi Sharma TY CSE,CCOEW

Pankaj4152 commented 11 months ago

Can you please assign this to me?