Epic interview question

Substring replacing.