+ 14

✅[CHALLENGE] ✅ 🔢 SPLITTING STRINGS 🔡

>> Generate a string (at least 10 characters long) of random digits(0-9) and letters(A-Z). >> Then split it equally in half. >> If the string's length is odd, take the middle character and do the following ways: >> If it's a digit in the lower half (0-4), put it on the left split string. Otherwise, put it on the right half. >> Do the same thing if it's a letter. Lower half: (A-M) Upper half: (N-Z) >> Continue on splitting the strings until every string only has 1 character. Sample: "AC2Z34NKOP" Output: "AC2Z34NKOP" "AC2Z3", "4NKOP" "AC2", "Z3", "4NK", "OP" "AC", "2", "Z", "3", "4", "NK", "O", "P" "A", "C", "2","Z", "3", "4", "N", "K", "O", "P" >> Built-in split functions are not allowed.

2nd Jan 2018, 10:51 AM
Jonathan Pizarra (JS Challenger)
Jonathan Pizarra (JS Challenger) - avatar
10 Réponses
2nd Jan 2018, 3:37 PM
LukArToDo
LukArToDo - avatar
+ 10
https://code.sololearn.com/cztr6OSBx7KE/?ref=app
2nd Jan 2018, 2:03 PM
Kodirbek Makharov
Kodirbek Makharov - avatar
5th Jan 2018, 4:38 AM
Käzî Mrîdùl Høssäîn
Käzî Mrîdùl Høssäîn - avatar
+ 7
Well, I do enjoy manipulating strings. As soon as I get my previous challenges done, I'm on to this.
2nd Jan 2018, 11:42 AM
Nonov Urbiznes
Nonov Urbiznes - avatar
3rd Jan 2018, 8:59 AM
abdulazizumarovich
abdulazizumarovich - avatar
+ 5
My PHP solution with preg_match. https://code.sololearn.com/wc250DMvD6Fj
2nd Jan 2018, 9:25 PM
Bidch Arvil
Bidch Arvil - avatar
+ 4
https://code.sololearn.com/cEDc4f15Z5x8/#java
2nd Jan 2018, 10:04 PM
István Ócsai
István Ócsai - avatar
3rd Jan 2018, 8:28 PM
Luc Hariman Randrianomenjanahary
Luc Hariman Randrianomenjanahary - avatar
+ 1
Super 👍🏻
2nd Jan 2018, 6:42 PM
Mia
+ 1
Finally, I found some time to work on this, and I really enjoyed it. It probably looks awkard but still, that's my final answer (with a twist). Hope you'll like it ! https://code.sololearn.com/c28X7zjUIQNn/?ref=app
13th Jan 2018, 2:19 PM
Nonov Urbiznes
Nonov Urbiznes - avatar