title: Lexicographically Minimum String Rotation
signature: lexicographicallyMinimumStringRotation :: String -> String
  lexicographicallyMinimumStringRotation str = 
test_code: import Text.Printf
  import Control.Exception (catch, SomeException)
  import Data.Typeable
  import qualified Data.List as List
  import qualified Data.Map as Map
  import qualified Data.Set as Set
  
  -- SOLUTION CODE
  -- ============================================
  
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  validateSolution :: String -> String -> Bool
  validateSolution actual expected = do
      actual == expected
  
  
  driver :: String -> String -> String
  driver str expected = do
      if (validateSolution (PLACEHOLDER_FN_NAME str) expected)
          then "PASSED"
      else "FAILED"
  
  main = do
      printf "TEST-0...%s\n" (driver ("onWEchl") ("EchlonW") )
  
      printf "TEST-1...%s\n" (driver ("2") ("2") )
  
      printf "TEST-2...%s\n" (driver ("100") ("001") )
  
      printf "TEST-3...%s\n" (driver ("GHbCZA") ("AGHbCZ") )
  
      printf "TEST-4...%s\n" (driver ("50568798206105") ("05505687982061") )
  
      printf "TEST-5...%s\n" (driver ("001011110001") ("000100101111") )
  
      printf "TEST-6...%s\n" (driver ("lljpYhznnyu") ("Yhznnyulljp") )
  
      printf "TEST-7...%s\n" (driver ("54499921759984") ("17599845449992") )
  
      printf "TEST-8...%s\n" (driver ("11101") ("01111") )
  
      printf "TEST-9...%s\n" (driver ("qvypgCYEjsyjwZ") ("CYEjsyjwZqvypg") )
  
source_py: def lexicographically_minimum_string_rotation(str_):
      n = len(str_)
      arr = ([0] * n)
      concat = (str_ + str_)
      for i in range(n):
          arr[i] = concat[i:(n + i)]
      arr.sort()
      return arr[0]
source_cpp: string lexicographically_minimum_string_rotation(string str) {
    int n = str . length ( );
    string arr [ n ];
    string concat = str + str;
    for ( int i = 0;
    i < n;
    i ++ ) arr [ i ] = concat . substr ( i, n );
    sort ( arr, arr + n );
    return arr [ 0 ];
  }