title: Decode Median String Original String
signature: function decode_median_string_original_string(s)
source_py: def decode_median_string_original_string(s):
      l = len(s)
      s1 = ''
      if ((l % 2) == 0):
          isEven = True
      else:
          isEven = False
      for i in range(0, l, 2):
          if isEven:
              s1 = (s[i] + s1)
              s1 += s[(i + 1)]
          elif ((l - i) > 1):
              s1 += s[i]
              s1 = (s[(i + 1)] + s1)
          else:
              s1 += s[i]
      return s1
source_cpp: string decode_median_string_original_string(string s) {
    int l = s . length ( );
    string s1 = "";
    bool isEven = ( l % 2 == 0 ) ? true : false;
    for ( int i = 0;
    i < l;
    i += 2 ) {
      if ( isEven ) {
        s1 = s [ i ] + s1;
        s1 += s [ i + 1 ];
      }
      else {
        if ( l - i > 1 ) {
          s1 += s [ i ];
          s1 = s [ i + 1 ] + s1;
        }
        else {
          s1 += s [ i ];
        }
      }
    }
    return s1;
  }
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(s, expected)
      local exec_result;
      local status, error_msg = pcall(function () 
          exec_result=PLACEHOLDER_FN_NAME(s) 
      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(" EgvQCeqYpZtv", "tpqCvE gQeYZv")
      print(string.format("TEST-0...%s",result))
  
      result = driver("488540", "484850")
      print(string.format("TEST-1...%s",result))
  
      result = driver("0000101010111", "1000000011111")
      print(string.format("TEST-2...%s",result))
  
      result = driver("syw", "ysw")
      print(string.format("TEST-3...%s",result))
  
      result = driver("402355", "524035")
      print(string.format("TEST-4...%s",result))
  
      result = driver("0", "0")
      print(string.format("TEST-5...%s",result))
  
      result = driver("wmHMlAtq", "tlHwmMAq")
      print(string.format("TEST-6...%s",result))
  
      result = driver("7962", "6792")
      print(string.format("TEST-7...%s",result))
  
      result = driver("111111", "111111")
      print(string.format("TEST-8...%s",result))
  
      result = driver("UbgRGDquop", "oqGgUbRDup")
      print(string.format("TEST-9...%s",result))
  
  end
  
  main()
question_info.entry_cls_name: Solution
question_info.test_list: [{"idx": 0, "outputs": "tpqCvE gQeYZv", "inputs": {"s": " EgvQCeqYpZtv"}}, {"idx": 1, "outputs": "484850", "inputs": {"s": "488540"}}, {"idx": 2, "outputs": "1000000011111", "inputs": {"s": "0000101010111"}}, {"idx": 3, "outputs": "ysw", "inputs": {"s": "syw"}}, {"idx": 4, "outputs": "524035", "inputs": {"s": "402355"}}, {"idx": 5, "outputs": "0", "inputs": {"s": "0"}}, {"idx": 6, "outputs": "tlHwmMAq", "inputs": {"s": "wmHMlAtq"}}, {"idx": 7, "outputs": "6792", "inputs": {"s": "7962"}}, {"idx": 8, "outputs": "111111", "inputs": {"s": "111111"}}, {"idx": 9, "outputs": "oqGgUbRDup", "inputs": {"s": "UbgRGDquop"}}]
question_info.extension: lua
question_info.entry_fn_name: decode_median_string_original_string
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: lua __FILENAME__