title: Perfect Reversible String
signature: func perfectReversibleString(str string) bool {
test_code: package main
  
  import (
      "fmt"
      "reflect"
      "math"
      "sort"
  )
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  func validateSolution(actual bool, expected bool) bool {
      return reflect.DeepEqual(actual,expected)
  }
  
  func driver(str string, expected bool) string {
      if validateSolution(PLACEHOLDER_FN_NAME(str),expected) {
              return "PASSED"
      }
      return "FAILED"
  
  }
  
  func main() {
  
      // Use imports to avoid undefined errors
      var _ = reflect.DeepEqual
      _ = math.Abs
      _ = sort.Sort
      result := ""
      result = driver("ab", false)
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver("303", true)
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver("11110000", false)
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver("aba", true)
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver("404", true)
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver("10101", true)
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver("abab", false)
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver("6366", false)
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver("001", false)
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver("", true)
      fmt.Printf("TEST-9...%s\n", result)
      
          
  }
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;
  }