How to make this output using javascript/C#?
Sample input below :
1,2,3,5,6,8,10,11,13,12
Output will be
1-3,5-6,8,10,13
Thanks in advance.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Ashutosh GuptaRank #805 · 2.9K reputationPosted Jan 24, 2020, 4:35 AM EST
Laxmidhar SahooRank #383 · 6.6K reputationPosted Jan 24, 2020, 6:04 AM EST