title: Perfect Reversible String
signature: function perfectReversibleString($str) {
test_code: <?php
  
  
  // SOLUTION CODE 
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function validateSolution($actual, $expected){
      return serialize($actual) == serialize($expected);
  }
  
  function driver($str, $expected){
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME($str), $expected)){
          return "PASSED";
        }
        return "FAILED";
      }
      catch (Exception $exception_obj) {
        return get_class($exception_obj);
      }
  }
  
  function main(){
      printf("TEST-0...%s\n",driver(
        "ab", 
        false));
      
      printf("TEST-1...%s\n",driver(
        "303", 
        true));
      
      printf("TEST-2...%s\n",driver(
        "11110000", 
        false));
      
      printf("TEST-3...%s\n",driver(
        "aba", 
        true));
      
      printf("TEST-4...%s\n",driver(
        "404", 
        true));
      
      printf("TEST-5...%s\n",driver(
        "10101", 
        true));
      
      printf("TEST-6...%s\n",driver(
        "abab", 
        false));
      
      printf("TEST-7...%s\n",driver(
        "6366", 
        false));
      
      printf("TEST-8...%s\n",driver(
        "001", 
        false));
      
      printf("TEST-9...%s\n",driver(
        "", 
        true));
      
  }
  
  main();
  ?>
source_py: def perfect_reversible_string(str):
      i = 0
      j = (len(str) - 1)
      while (i < j):
          if (str[i] != str[j]):
              return False
          i += 1
          j -= 1
      return True
source_cpp: bool perfect_reversible_string(string str) {
    int i = 0, j = str . length ( ) - 1;
    while ( i < j ) {
      if ( str [ i ] != str [ j ] ) return false;
      i ++;
      j --;
    }
    return true;
  }