title: Lexicographically Minimum String Rotation
signature: function lexicographically_minimum_string_rotation(str_)
test_code: using Printf
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  function validate_solution(actual, expected)
      return actual == expected
  end
  
  function driver(str_, expected)
      try
  
          if validate_solution(PLACEHOLDER_FN_NAME(str_), expected)
              return "PASSED";
          end
          return "FAILED";
      catch exception_obj
          return string(Base.typename(typeof(exception_obj)).wrapper);
      end
  end
  
  function main()
      
      result = driver("onWEchl", "EchlonW");
      @printf("TEST-0...%s\n",result);
      
      result = driver("2", "2");
      @printf("TEST-1...%s\n",result);
      
      result = driver("100", "001");
      @printf("TEST-2...%s\n",result);
      
      result = driver("GHbCZA", "AGHbCZ");
      @printf("TEST-3...%s\n",result);
      
      result = driver("50568798206105", "05505687982061");
      @printf("TEST-4...%s\n",result);
      
      result = driver("001011110001", "000100101111");
      @printf("TEST-5...%s\n",result);
      
      result = driver("lljpYhznnyu", "Yhznnyulljp");
      @printf("TEST-6...%s\n",result);
      
      result = driver("54499921759984", "17599845449992");
      @printf("TEST-7...%s\n",result);
      
      result = driver("11101", "01111");
      @printf("TEST-8...%s\n",result);
      
      result = driver("qvypgCYEjsyjwZ", "CYEjsyjwZqvypg");
      @printf("TEST-9...%s\n",result);
      
  end
  
  main()
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 ];
  }