Domanda di colloquio di HashiCorp

Find multiple approach to a problem statement and execute one which takes less time to execute. Problem statement: Find substring from given string.