LOGO100 logo

Chainlink challenge

chainlink logo

Given a string s, where * represents a star…

Remove the star along with its closest non-star character to its left in a single operation.

The task is to perform this operation until all stars have been removed and to return the string that remains.

Assumptions

Examples (test cases!)

chainlink → chainlink
chaa*inlinn*k → chainlink
abc*de*f  → abdf
a*b*c*d →  d
abcd → abcd
abc*de*  → abd

You can use this JSON object to test your function.

Submit your solutions at this gist - we’ll pick the one we like the best and get you something nice.

Back to all puzzles