title: Perfect Reversible String
signature: fun perfectReversibleString(str: String): Boolean {
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;
  }
question_info.test_list: [{"idx": 0, "outputs": false, "inputs": {"str": "ab"}}, {"idx": 1, "outputs": true, "inputs": {"str": "303"}}, {"idx": 2, "outputs": false, "inputs": {"str": "11110000"}}, {"idx": 3, "outputs": true, "inputs": {"str": "aba"}}, {"idx": 4, "outputs": true, "inputs": {"str": "404"}}, {"idx": 5, "outputs": true, "inputs": {"str": "10101"}}, {"idx": 6, "outputs": false, "inputs": {"str": "abab"}}, {"idx": 7, "outputs": false, "inputs": {"str": "6366"}}, {"idx": 8, "outputs": false, "inputs": {"str": "001"}}, {"idx": 9, "outputs": true, "inputs": {"str": ""}}]
question_info.extension: kts
question_info.test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Boolean, expected:Boolean):Boolean{
    return actual.equals(expected)
  }
  fun driver(str: String, expected:Boolean):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(str), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver("ab", false)
      println("TEST-0...${result}")
      
      result = driver("303", true)
      println("TEST-1...${result}")
      
      result = driver("11110000", false)
      println("TEST-2...${result}")
      
      result = driver("aba", true)
      println("TEST-3...${result}")
      
      result = driver("404", true)
      println("TEST-4...${result}")
      
      result = driver("10101", true)
      println("TEST-5...${result}")
      
      result = driver("abab", false)
      println("TEST-6...${result}")
      
      result = driver("6366", false)
      println("TEST-7...${result}")
      
      result = driver("001", false)
      println("TEST-8...${result}")
      
      result = driver("", true)
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: perfectReversibleString
question_info.entry_cls_name: Solution
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: kotlinc -script __FILENAME__ -no-reflect -nowarn