Split the Atomic Numbers

0

0 votes
Medium
Problem

Due to a nuclear test conducted by North Korea to prove it's power to the developed nations, the atomic numbers of some elements have joined together. Chandler Bing - the senior research analyst of BARC has to device a mechanism to seperate the numbers in such a way that the next number to the current number should be consecutive.

 

 

Given a series find whether they're consecutive or not. If the series is consecutive print "diffusion success" and also print the starting and ending numbers of the series. If not consecutive, print "diffusion failed".

Don't consider leading zeros. Ex : "010203" not equals to "01"+"02"+"03"

Sample Input :

1234

Sample Output :

diffusion success 1 4

Time Limit: 5
Memory Limit: 256
Source Limit:
Editor Image

?