Santhosh Subramaniam

Santhosh Subramaniam

  • NA
  • 226
  • 108.9k

How to make this out put using Javascript/C#?

Jan 23 2020 11:53 PM
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. 

Answers (2)