Check if parenthesis are balanced problem with * (Typescript)

My solution to a “Daily Coding Problem” that I received in my mail today. You’re given a string consisting solely of (, ), and *. * can represent either a (, ), or an empty string. Determine whether the parentheses are balanced. For example, (()* and (*) are balanced. )*( is not balanced. Here’s my solution in Typescript, oneFortyTwo(str: string): boolean { if(str Read more…