☢️CHALLENGE☢️: Typoglycemia | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 12

☢️CHALLENGE☢️: Typoglycemia

Typoglycemia is the mind's ability to decipher a mispelled word if the first and last letters of the word are correct. Make a program that receives user input and outputs the typoglycemic version of the string. Example: Input: "I love SoloLearn" Output: "I lvoe SLloorean" Good luck and good coding!

30th Jan 2018, 11:26 PM
Murillo Pyaia
Murillo Pyaia - avatar
17 Answers
+ 11
I've try to complete your challenge but it's quite hard for me, actually blow out my mind 😵
31st Jan 2018, 5:37 AM
Tran Huu Dang
Tran Huu Dang - avatar
+ 9
That seems so simple in python, actually I write something in js but it took me about 30 line of code.
31st Jan 2018, 6:19 AM
Tran Huu Dang
Tran Huu Dang - avatar
31st Jan 2018, 10:26 PM
Si Ogn
+ 7
cool challenge!
31st Jan 2018, 7:44 PM
Oma Falk
Oma Falk - avatar
+ 5
https://code.sololearn.com/cJLf881llCUm/#py I considered some cases of punctuation, cases in which there is a non-alphabetical character by the end of a "word". In these cases, the actual last letter in the word is preserved. Also thought I should preserve digits.
3rd Feb 2018, 5:05 AM
Pedro Demingos
Pedro Demingos - avatar
+ 4
Not answer to your question but method to recognize mistyped.words https://code.sololearn.com/cpt2y6cI8b72/?ref=app
31st Jan 2018, 7:03 AM
VcC
VcC - avatar
+ 4
tahnk you vrey mcuh
31st Jan 2018, 7:56 PM
VcC
VcC - avatar
+ 4
2nd Feb 2018, 8:01 AM
Ng Ju Ping
Ng Ju Ping - avatar
+ 4
It is a cool challenge and my code: https://code.sololearn.com/c1P9JNqPain9
2nd Feb 2018, 8:44 AM
rahim
rahim - avatar
+ 4
My python, using regex and dealing with punctuation : https://code.sololearn.com/cliCb9284Abg/#py Edited : Now the sample won't return unscrambelled words (It happens easily with 4 or 5 letters words).
3rd Feb 2018, 3:14 PM
Cépagrave
Cépagrave - avatar
+ 3
"Typoglycemia"? I hope this neologism doesn't catch on, because "glycemia" means blood sugar.
8th Feb 2018, 5:50 PM
Eric Blinkidu
Eric Blinkidu - avatar
+ 2
@Maria G. I made this lazy code in python to serve as inspiration. It's lazy because it keeps each word's first and last letters and then reverse the letters in between, but there are much more funny and randomly-got ways to do it. https://code.sololearn.com/cpf19SD6fmRe/?ref=app
31st Jan 2018, 6:02 AM
Murillo Pyaia
Murillo Pyaia - avatar
+ 2
Congratulations, @VcC! Now you win fair and square. But the rest may keep posting their codes!
31st Jan 2018, 7:48 PM
Murillo Pyaia
Murillo Pyaia - avatar
31st Jan 2018, 11:51 PM
Luis Lopes
Luis Lopes - avatar
0
@VcC very cool!
31st Jan 2018, 7:05 AM
Murillo Pyaia
Murillo Pyaia - avatar
0
If nobody answers until the end of the day (in Brazil), I'll mark @VcC's code as the correct answer, even though it's another type of code
31st Jan 2018, 6:42 PM
Murillo Pyaia
Murillo Pyaia - avatar