Cycling Through Strings

Published by Mubashir Hassan in

Given two strings, repeatedly cycle through all of the letters in the first string until it is the same length as the second string.

Examples

stringCycling("abc", "hello") ➞ "abcab"

stringCycling("programming", "edabit") ➞ "progra"

stringCycling("ha", "good morning") ➞ "hahahahahaha"

Notes

All tests will include valid strings.

Watch a quick demo on how Edabit works.