PriceLabs interview question

2 Dsa questions. Easy, array & string based.