Given environment variables & string pattern which uses vairables, return final formated string by substituting environment variable values. Design Lib for this.
Input -
Environment variable -
"PYTHON" : "/lib/python/bin"
Pattern :
"/username/%PYTHON%"
Output -
"/username/lib/python/bin"
I was able to solve this but not able to complete the code.
Time complexity - O (n^2) where n is length of pattern & length of param
Environment varaible can have variables too which made it little complex.
Answer & Time complexity in the comment will be appreciated.