Daily Challenge #28 - another challenge for today

String Explosion

Given a string like “Code” return a string like “CCoCodCode”.

Examples:

stringExplode(Code) → CCoCodCode (transformation is like this: C, Co, Cod, Code)
stringExplode(abc) → aababc
stringExplode(ab) → ab

Requirement:
Minimum 3 characters
If less than 3, return the string itself

5 Likes

/Boban

7 Likes

Great job @Boban. That was fast @Boban :grin: let’s see if we get solutions from others

2 Likes

Surely as we have good coders :grin:

Btw, does blocks counts, if so then it’s 35

/Boban

3 Likes

Blocks please @Boban :point_up:

Are we ‘coders’ or ‘koders’ ?
:thinking:

Mine have 22 blocks :sunglasses:

Here it is:
!

4 Likes

@vknow360 I think your procedure would NOT return expected result if length < 3. Right?

Fixed :+1: