Solved 612, DNA Sorting

Calculate the sortedness by counting number of smaller charater next to it and sort the strings based on the sortedness calculated in the previous step.