CommerceIQ interview question

Problems in Array and strings