title: Lexicographically Minimum String Rotation
signature: func lexicographicallyMinimumStringRotation(str_ string) string {
test_code: package main
  
  import (
      "fmt"
      "reflect"
      "math"
      "sort"
  )
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  func validateSolution(actual string, expected string) bool {
      return reflect.DeepEqual(actual,expected)
  }
  
  func driver(str_ string, expected string) string {
      if validateSolution(PLACEHOLDER_FN_NAME(str_),expected) {
              return "PASSED"
      }
      return "FAILED"
  
  }
  
  func main() {
  
      // Use imports to avoid undefined errors
      var _ = reflect.DeepEqual
      _ = math.Abs
      _ = sort.Sort
      result := ""
      result = driver("onWEchl", "EchlonW")
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver("2", "2")
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver("100", "001")
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver("GHbCZA", "AGHbCZ")
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver("50568798206105", "05505687982061")
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver("001011110001", "000100101111")
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver("lljpYhznnyu", "Yhznnyulljp")
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver("54499921759984", "17599845449992")
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver("11101", "01111")
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver("qvypgCYEjsyjwZ", "CYEjsyjwZqvypg")
      fmt.Printf("TEST-9...%s\n", result)
      
          
  }
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 ];
  }