Lenskart Solutions interview question

1. One medium-level string-based problem