title: Lexicographically Minimum String Rotation
signature: function lexicographically_minimum_string_rotation(str_)
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 ];
  }
question_info.entry_fn_name: lexicographically_minimum_string_rotation
question_info.entry_cls_name: Solution
question_info.test_case_ids: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
question_info.test_code: 
  
  -- SOLUTION CODE
  -- ============================================
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  function isCorrect(actual, expected)
      if type(expected) ~= type(actual) then
          return false
      end
      
      if type(expected) == 'table' then
          for k,v_expected in pairs(expected) do
              
              if actual[k] == nil then
                  return false
              end
              local v_actual = actual[k]
              if not isCorrect(v_actual, v_expected) then
                  return false
              end
              actual[k]=nil
          end
      
          if next(actual) then 
              return false
          end
          return true
      else
          return actual == expected
      end
  end
  
  function validateSolution(actual, expected)
      return isCorrect(actual,expected)
  end
  
  function driver(str_, expected)
      local exec_result;
      local status, error_msg = pcall(function () 
          exec_result=PLACEHOLDER_FN_NAME(str_) 
      end)
      if status then
          if validateSolution(exec_result,expected) then
              return "PASSED"
          end
          return "FAILED"
      else
          return string.format("ERROR=%s",string.gsub(error_msg,".*:[%d]+: ",""))
      end
  end
      
  function main()
      result = driver("onWEchl", "EchlonW")
      print(string.format("TEST-0...%s",result))
  
      result = driver("2", "2")
      print(string.format("TEST-1...%s",result))
  
      result = driver("100", "001")
      print(string.format("TEST-2...%s",result))
  
      result = driver("GHbCZA", "AGHbCZ")
      print(string.format("TEST-3...%s",result))
  
      result = driver("50568798206105", "05505687982061")
      print(string.format("TEST-4...%s",result))
  
      result = driver("001011110001", "000100101111")
      print(string.format("TEST-5...%s",result))
  
      result = driver("lljpYhznnyu", "Yhznnyulljp")
      print(string.format("TEST-6...%s",result))
  
      result = driver("54499921759984", "17599845449992")
      print(string.format("TEST-7...%s",result))
  
      result = driver("11101", "01111")
      print(string.format("TEST-8...%s",result))
  
      result = driver("qvypgCYEjsyjwZ", "CYEjsyjwZqvypg")
      print(string.format("TEST-9...%s",result))
  
  end
  
  main()
question_info.test_list: [{"idx": 0, "outputs": "EchlonW", "inputs": {"str_": "onWEchl"}}, {"idx": 1, "outputs": "2", "inputs": {"str_": "2"}}, {"idx": 2, "outputs": "001", "inputs": {"str_": "100"}}, {"idx": 3, "outputs": "AGHbCZ", "inputs": {"str_": "GHbCZA"}}, {"idx": 4, "outputs": "05505687982061", "inputs": {"str_": "50568798206105"}}, {"idx": 5, "outputs": "000100101111", "inputs": {"str_": "001011110001"}}, {"idx": 6, "outputs": "Yhznnyulljp", "inputs": {"str_": "lljpYhznnyu"}}, {"idx": 7, "outputs": "17599845449992", "inputs": {"str_": "54499921759984"}}, {"idx": 8, "outputs": "01111", "inputs": {"str_": "11101"}}, {"idx": 9, "outputs": "CYEjsyjwZqvypg", "inputs": {"str_": "qvypgCYEjsyjwZ"}}]