LTM Limited interview question

- Write a pattern matching code?