+ 23

๐Ÿ† [M๐Ÿ’™ Challenge] Roller Coaster Number ๐ŸŽข

Monday Blue ๐Ÿ’™ Challenge Series #3 Let's have some fun! A roller coaster number can be obtained by populating all the numbers between 2 adjacent digits in range [0123456789]. ๐Ÿ’ผ TASK Write a program to accept an integer and produce the output in the following pattern (e.g. 10250):- [1 โฌ‡] [0 โฌ†] 1 [2 โฌ†] 3 4 [5 โฌ‡] 4 3 2 1 [0] ๐Ÿ”ง TEST CASE โ˜‘ 1 โ–ถ 1 โ˜‘ 123 โ–ถ 123 โ˜‘ 11111 โ–ถ 11111 โ˜‘ 1233 โ–ถ 1233 โ˜‘ 00123 โ–ถ 00123 โ˜‘ 191 โ–ถ 12345678987654321 โ˜‘ 00179 โ–ถ 00123456789 โ˜‘ 12375 โ–ถ 123456765 โ˜‘ 15552 โ–ถ 1234555432 โ˜‘ 17900 โ–ถ 1234567898765432100 โ˜‘ 030201 โ–ถ 012321012101 โ˜‘ 152857 โ–ถ 1234543234567876567 Happy Coding!!! ๐Ÿ˜๐Ÿ’ป

16th Oct 2017, 1:28 PM
Zephyr Koo
Zephyr Koo - avatar
24 Answers
2nd Oct 2017, 3:33 AM
๐Ÿ‘‘ Prometheus ๐Ÿ‡ธ๐Ÿ‡ฌ
๐Ÿ‘‘ Prometheus ๐Ÿ‡ธ๐Ÿ‡ฌ - avatar
2nd Oct 2017, 9:12 AM
David Akhihiero
David Akhihiero - avatar
2nd Oct 2017, 5:24 AM
m abrate
m abrate - avatar
2nd Oct 2017, 10:29 PM
Vukan
Vukan - avatar
+ 10
@@@@@@@@@@@@@ @@@@@@@@@@@@@ ################# Looking for something CREATIVE? Then creativity is here. Try to make your ride more THRILLING! _____________________________ GOOD LUCK! _____________________________ https://code.sololearn.com/cb91qCxHlK1C/?ref=app
2nd Oct 2017, 7:18 PM
Saurav Priyadarshi
Saurav Priyadarshi - avatar
+ 9
@ kartikey indeed thats right but i love this python syntax actually...๐Ÿ˜‚๐Ÿ˜‚๐Ÿ˜๐Ÿ˜€๐Ÿ˜Šโ˜บ
2nd Oct 2017, 4:48 AM
sayan chandra
sayan chandra - avatar
+ 8
What IS the pattern??
2nd Oct 2017, 3:25 AM
๐Ÿ‘‘ Prometheus ๐Ÿ‡ธ๐Ÿ‡ฌ
๐Ÿ‘‘ Prometheus ๐Ÿ‡ธ๐Ÿ‡ฌ - avatar
+ 7
Nope $Vengat please refer to my test cases above and try again~ ๐Ÿ˜‰
2nd Oct 2017, 3:38 AM
Zephyr Koo
Zephyr Koo - avatar
+ 7
My try ( ๏ฝฅเธดฯ‰๏ฝฅเธด) https://code.sololearn.com/cpna7oU6myZT/?ref=app
2nd Oct 2017, 4:21 AM
hmysjiang๐Ÿ€
hmysjiang๐Ÿ€ - avatar
+ 7
https://code.sololearn.com/cd82GPQSH5lZ/?ref=app
2nd Oct 2017, 4:23 AM
Martin Mรถhle
Martin Mรถhle - avatar
+ 7
heres my 2 line code...##excluding input https://code.sololearn.com/c1YdrUmJJ19J/?ref=app
2nd Oct 2017, 4:38 AM
sayan chandra
sayan chandra - avatar
+ 7
Thanks for all the submissions and I've seen some intresting one, still looking for someone that can solve it in a clean and creative way! Good job everybody! ๐Ÿ˜„๐Ÿ‘
2nd Oct 2017, 2:38 PM
Zephyr Koo
Zephyr Koo - avatar
2nd Oct 2017, 4:26 AM
Kartikey Sahu
Kartikey Sahu - avatar
+ 6
@# Martin 11111 in your code gets 1 instead of 11111
2nd Oct 2017, 4:35 AM
hmysjiang๐Ÿ€
hmysjiang๐Ÿ€ - avatar
+ 6
Sayan, You don't have to make it shorter, make it human readable because that's what a good programmer does
2nd Oct 2017, 4:40 AM
Kartikey Sahu
Kartikey Sahu - avatar
+ 6
# hmysjiang fixed
2nd Oct 2017, 4:42 AM
Martin Mรถhle
Martin Mรถhle - avatar
+ 6
Third challenge complete! https://code.sololearn.com/c7G7YbKg5db1
2nd Oct 2017, 6:23 AM
Krystoffer Strong
Krystoffer Strong - avatar
+ 6
My try without using string. (So 00123 will be considered like 123) https://code.sololearn.com/cxcJnhzRLARV/?ref=app
2nd Oct 2017, 9:08 AM
Andrea Simone Costa
Andrea Simone Costa - avatar
+ 6
Here's my own C# implementation! โœŒ Thanks everyone for your participation! To be honest I've hard time for picking the best answer this round as there are a few straight-forward and creative algorithms. Anyway let's move on to the next challenge! โค https://code.sololearn.com/cX4A7UssFE69/?ref=app https://www.sololearn.com/Discuss/774727/?ref=app
9th Oct 2017, 3:29 AM
Zephyr Koo
Zephyr Koo - avatar
+ 5
Let's take 303 as an example, [3] โฌ‡ 2 1 [0] โฌ† 1 2 [3] and you'll get 3210123! ๐Ÿ˜‰
2nd Oct 2017, 3:28 AM
Zephyr Koo
Zephyr Koo - avatar