title: Perfect Reversible String
signature: perfect_reversible_string <- function(str) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(str, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(str), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          "ab", 
          FALSE
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          "303", 
          TRUE
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          "11110000", 
          FALSE
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          "aba", 
          TRUE
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          "404", 
          TRUE
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          "10101", 
          TRUE
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          "abab", 
          FALSE
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          "6366", 
          FALSE
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          "001", 
          FALSE
      )))
  
      cat(sprintf("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;
  }