Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis+ 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!!! šš»
23 Respostas
+ 11
https://code.sololearn.com/cf5vcJZjlnSF/?ref=app
Tell me improvement
+ 13
+ 11
+ 11
+ 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
+ 9
@ kartikey
indeed thats right
but i love this python syntax actually...šššššāŗ
+ 8
What IS the pattern??
+ 7
Nope $Vengat please refer to my test cases above and try again~ š
+ 7
My try ( ļ½„ąø“Ļļ½„ąø“)
https://code.sololearn.com/cpna7oU6myZT/?ref=app
+ 7
https://code.sololearn.com/cd82GPQSH5lZ/?ref=app
+ 7
heres my 2 line code...##excluding input
https://code.sololearn.com/c1YdrUmJJ19J/?ref=app
+ 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! šš
+ 6
@# Martin
11111 in your code gets 1 instead of 11111
+ 6
Sayan, You don't have to make it shorter, make it human readable because that's what a good programmer does
+ 6
# hmysjiang fixed
+ 6
Third challenge complete!
https://code.sololearn.com/c7G7YbKg5db1
+ 6
My try without using string.
(So 00123 will be considered like 123)
https://code.sololearn.com/cxcJnhzRLARV/?ref=app
+ 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
+ 5
Let's take 303 as an example,
[3] ā¬
2
1
[0] ā¬
1
2
[3]
and you'll get 3210123! š