title: Advanced string manipulation from job online
body: <p>I just did a company online and i couldnt get this question right..</p>
  
  <p>looking to improve for next online assessment.</p>
  
  <p>question is:
  your given 1 input string where the format is like this:</p>
  
  <p>current:target</p>
  
  <pre><code>   where current = Company,Stock or Bond,amount
  
     and target = Company,Stock or Bond,amount
  </code></pre>
  
  <p>and the ':' separates current and target</p>
  
  <p>an example is:</p>
  
  <pre><code>    Vodafone,STOCK,10|Google,STOCK,15|Microsoft,BOND,15:Vodafone,STOCK,15|Google,STOCK,10|Microsoft,BOND,15
  </code></pre>
  
  <p>the output should be a string that makes the input meet the output for this case its going to be:</p>
  
  <pre><code>  SELL,Google,STOCK,5
    BUY,Vodafone,STOCK,5
  </code></pre>
  
  <p>as you can see the ouput should be in alphabetical order (google is before vodafone) and also bonds should appear before stocks.</p>
  
  <p>here is some setup code to help you:</p>
  
  <pre><code>public class main {
  
  
      public static void main(String[] args){
          String input = "Vodafone,STOCK,10|Google,STOCK,15|Microsoft,BOND,15:Vodafone,STOCK,15|Google,STOCK,10|Microsoft,BOND,15";
          String output = matchBenchmark(input);
          System.out.println(output);
      }
  
      public static String matchBenchmark(String input){
  
      }
  }
  </code></pre>