title: Perfect Reversible String
signature: perfectReversibleString(str) {
test_code: import 'dart:convert';
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  bool validateSolution(bool actual, bool expected){
      return actual.toString() == expected.toString();
  }
  
  String driver(str, bool expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(str), expected)){
              return "PASSED";
          }
          return "FAILED";
      }catch(exception_object){
          return exception_object.runtimeType.toString();
      }
  }
  
  int main() {
  
      print("TEST-0...${driver(
          "ab", 
          false)
      }");
  
      print("TEST-1...${driver(
          "303", 
          true)
      }");
  
      print("TEST-2...${driver(
          "11110000", 
          false)
      }");
  
      print("TEST-3...${driver(
          "aba", 
          true)
      }");
  
      print("TEST-4...${driver(
          "404", 
          true)
      }");
  
      print("TEST-5...${driver(
          "10101", 
          true)
      }");
  
      print("TEST-6...${driver(
          "abab", 
          false)
      }");
  
      print("TEST-7...${driver(
          "6366", 
          false)
      }");
  
      print("TEST-8...${driver(
          "001", 
          false)
      }");
  
      print("TEST-9...${driver(
          "", 
          true)
      }");
  
      return 0;
  }
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;
  }