title: Printing a number with appropriate commas recursively
body: <p>A sample input of 12345 should return 12,345. I have it figured out i think. Only problem is the string I get is reversed (543,21). Now i know there's ways to reverse a string pretty easily but that's more complexity to the running time so I was wondering if there was a straightforward way to do it within the auxiliary itself?</p>
  
  <pre><code>public void print(int n){
              String number = Integer.toString(n);
              StringBuilder answer = new StringBuilder();
              if(number.length() &gt; 3){ //Only worry about adding commas if its more than three digits
                  printAux(number, answer, 1, number.length()-1);
                  System.out.println(answer);
              }
          }
  
          private void printAux(String s, StringBuilder answer, int count, int index){
               if(index &lt; 0){
                   return;
               }
               else{
                   //If the counter is at the 4th index meaning it has passed three digits
                   if(count%3 == 1 &amp;&amp; count &gt; 3){
                       answer.append(",");
                       index = index + 1;
                       count = 0;
                   }
                   else{
                       answer.append(s.charAt(index));
                   }
                   printAux(s, answer, count + 1, index - 1);
               }
          }
  </code></pre>