title: Pattern evaluater
body: <p>I have some a string which needed to be evaluated in following pattern - </p>
  
  <pre><code>Input  =&gt; String testTree = "(1(2(4)())(3))";   
  Output =&gt; {1,2,3,4,*,*,*}
  
  Input  =&gt; String testTree2 = "(1(2(4)(5))(3()(4()(3))))";   
  Output =&gt; {1,2,3,4,5,*,4,*,*,*,*,*,*,*,3}
  
  Input  =&gt; String testTree3 = "(1()())";   
  Output =&gt;{1,*,*}
  </code></pre>
  
  <p>Above mention inputs have same pattern , where '()' or null is represented as '<strong>*</strong>'.Output is been saved to a int/string array , hence output form is like so.</p>
  
  <p>Kindly suggest a method to evaluate such kind of pattern to the output form.</p>