title: Decode Median String Original String
signature: function decodeMedianStringOriginalString(s) {
test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value) {
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual, expected){
      return convertToString(actual)===convertToString(expected);
  }
  
  function driver(s, expected){
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(s),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(" EgvQCeqYpZtv", "tpqCvE gQeYZv");
    console.log(`TEST-0...${result}`);
  
    result = driver("488540", "484850");
    console.log(`TEST-1...${result}`);
  
    result = driver("0000101010111", "1000000011111");
    console.log(`TEST-2...${result}`);
  
    result = driver("syw", "ysw");
    console.log(`TEST-3...${result}`);
  
    result = driver("402355", "524035");
    console.log(`TEST-4...${result}`);
  
    result = driver("0", "0");
    console.log(`TEST-5...${result}`);
  
    result = driver("wmHMlAtq", "tlHwmMAq");
    console.log(`TEST-6...${result}`);
  
    result = driver("7962", "6792");
    console.log(`TEST-7...${result}`);
  
    result = driver("111111", "111111");
    console.log(`TEST-8...${result}`);
  
    result = driver("UbgRGDquop", "oqGgUbRDup");
    console.log(`TEST-9...${result}`);
  
    process.exit(0);
  };
  
  if (require.main === module) {
    main();
  }
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;
  }