***[SUPER_CHALLENGE]*** ver.2.0 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 8

***[SUPER_CHALLENGE]*** ver.2.0

Arrange text by contained numbers in its words. For example input: "1i057s I100t0 20a18 9te99xt9 si30mp5L9e" outputs: "It is a simpLe text"

24th Dec 2017, 6:34 AM
dimon2101
dimon2101 - avatar
22 Answers
25th Dec 2017, 6:23 PM
LukArToDo
LukArToDo - avatar
+ 13
https://code.sololearn.com/cgIV6r6o9v33/?ref=app
24th Dec 2017, 10:31 AM
Käzî Mrîdùl Høssäîn
Käzî Mrîdùl Høssäîn - avatar
+ 10
@dimon.. Thanks-
24th Dec 2017, 1:07 PM
Käzî Mrîdùl Høssäîn
Käzî Mrîdùl Høssäîn - avatar
+ 8
abstract, easy to read, and was already solved a few hours ago (check another challenge for full commentary). https://code.sololearn.com/w8Yopd2USboD/?ref=app
25th Dec 2017, 5:18 AM
Freezemage
Freezemage - avatar
24th Dec 2017, 7:29 AM
dimon2101
dimon2101 - avatar
+ 6
Kazy's answer accepted too ))) Beautiful!!!
24th Dec 2017, 11:10 AM
dimon2101
dimon2101 - avatar
+ 6
Two statements: first to be able to show the input in the result, but easily it can be inserted into the output line. Try it please. 😊👇 https://code.sololearn.com/c0F112vXwUFQ/?ref=app Edit: In honor of LukArToDo now also contains explanation.
24th Dec 2017, 11:56 PM
Marfik Em
Marfik Em - avatar
+ 6
@dimon2101 Thanks for the motivation ☺👍 but I think the SoloLearn compiler for C# isn't very good. For me it works at the third run. Anyway I modified the code to demonstrate your example. See it again, only press submit if you don't want to write a test.
25th Dec 2017, 1:42 AM
Marfik Em
Marfik Em - avatar
+ 5
Ipang, i think that at first step we see in words only numbers without letters and arrange its position in inputted text. At second step we must throw away digits from words :-) p.s. there is no pattern, only spaces in input
24th Dec 2017, 7:01 AM
dimon2101
dimon2101 - avatar
+ 5
Oh, so we need to extract the numbers first, then strip them from the string, then we place the words depending on the number, ascending, am I understanding correctly? I hope so. I may give it a try. Thanks : )
24th Dec 2017, 7:16 AM
Ipang
+ 5
Thank you, Luc!!! :-D But we have Christmas Eve at 06.01.2018
25th Dec 2017, 10:27 AM
dimon2101
dimon2101 - avatar
+ 4
@Dimon2101 I need clarification here, "I100t0" => It (alphabet at first position, first word) "1i057s" => is (alphabet at second position, second word) "20a18" => a (alphabet at third position, third word) So far this makes a pattern, but the next two, "si30mp5L9e" => ?? (alphabet at first position) "9te99xt9" => ?? (alphabet at second position) What is the pattern? I'm confused here. How to know the order of words in the sentence?
24th Dec 2017, 6:54 AM
Ipang
24th Dec 2017, 9:42 AM
Kodirbek Makharov
Kodirbek Makharov - avatar
+ 4
Congradulations to Qodirbek!!! C++ for all!!!
24th Dec 2017, 10:06 AM
dimon2101
dimon2101 - avatar
+ 4
Marfic's code outputs "Compilation error" on "1i057s I100t0 20a18 9te99xt9 si30mp5L9e". Daniel's program has throw away digits but there is no sorting effect. You're near from right result, don't give up!!!
25th Dec 2017, 1:15 AM
dimon2101
dimon2101 - avatar
+ 4
Guys, look at the Luc's code! Example of clear mind and cool heart )))))))))) And i dont know how it works.... :-/
25th Dec 2017, 4:48 AM
dimon2101
dimon2101 - avatar
+ 4
New Crazy Wondering Code from LukArToDo with explanation!!!
25th Dec 2017, 6:46 PM
dimon2101
dimon2101 - avatar
25th Dec 2017, 1:42 AM
Luc Hariman Randrianomenjanahary
Luc Hariman Randrianomenjanahary - avatar
+ 3
@dimon2101, I’ll comment the code with explanations later. Enjoy the christmas day 🙂
25th Dec 2017, 7:35 AM
Luc Hariman Randrianomenjanahary
Luc Hariman Randrianomenjanahary - avatar
+ 2
I think I prefer this version. So, let's see...
3rd Jan 2018, 9:03 PM
Nonov Urbiznes
Nonov Urbiznes - avatar