Samsara Interview Question

Live coding problem with strings