Skip to content

Instantly share code, notes, and snippets.

@abbath0767
Created February 24, 2016 15:32
Show Gist options
  • Save abbath0767/11b9c1b79c20ed4188c9 to your computer and use it in GitHub Desktop.
Save abbath0767/11b9c1b79c20ed4188c9 to your computer and use it in GitHub Desktop.
7 kyu Sort the Gift Code
import java.util.Arrays;
public class GiftSorter{
public String sortGiftCode(String code){
String[] arrayOfSymbol = code.split("");
Arrays.sort(arrayOfSymbol);
StringBuilder sb = new StringBuilder();
for (String oneSymbol: arrayOfSymbol)
sb.append(oneSymbol);
return sb.toString();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment