https://realcoder.techss24.com/solved-substring-with-concatenation/3615/