Sort the prefix with global frequency( 39sec )

Sort the prefix of List1 and List2 in advance