Dakti 🌊🌴

Published by Mubashir Hassan in

Juan loves the Dakti song and wants to memorize the chorus of the song. His friend sent him the chorus in phrases, but the phrases are somewhat strange; they do not have an order and they have numbers. His friend helps Juan organize the chorus of the song.

Use RegEx, natural sorting, sorting, or lambda functions; your imagination has no limits.

First, organize the words based on the numbers they have, then delete the numbers once they are organized.

Three steps:

"worl2d hell1o " âžž " hell1o worl2d " âžž " hello world "

"i2s th1s a3 t4est    " âžž "th1is i2s a3 t4est" âžž "this is a test"

"yo2u cr3azy a1re ?  " âžž  "a1re yo2u cr3azy" âžž "are you crazy"

Here are some examples:

Examples

dakiti("en5tere y2a bab1y y3o 4me s6e not7a cuand8o 9me-ves") âžž "baby ya yo me entere se nota cuando me-ves"

dakiti("quie3res bebe4r dime1 e5s qu6e qu2e tu7 er8es m9i-bebe") âžž "ahi donde no has llegado sabes que yo te-llevare"

dakiti("quie3res bebe4r dime1 e5s qu6e qu2e tu7 er8es m9i-bebe") âžž "dime que quieres beber es que tu eres mi-bebe"

Notes

  • Trick, natural sort.
  • Remember if you have suggestions to improve the challenge instructions, leave a comment or suggest an edit :)
Watch a quick demo on how Edabit works.