title: Check String Can Obtained Rotating Another String 2 Places
signature: fun checkStringCanObtainedRotatingAnotherString2Places(str1: String, str2: String): Boolean {
source_py: def check_string_can_obtained_rotating_another_string_2_places(str1, str2):
      if (len(str1) != len(str2)):
          return False
      clock_rot = ''
      anticlock_rot = ''
      l = len(str2)
      anticlock_rot = ((anticlock_rot + str2[(l - 2):]) + str2[0:(l - 2)])
      clock_rot = ((clock_rot + str2[2:]) + str2[0:2])
      return ((str1 == clock_rot) or (str1 == anticlock_rot))
source_cpp: bool check_string_can_obtained_rotating_another_string_2_places(string str1, string str2) {
    if ( str1 . length ( ) != str2 . length ( ) ) return false;
    string clock_rot = "";
    string anticlock_rot = "";
    int len = str2 . length ( );
    anticlock_rot = anticlock_rot + str2 . substr ( len - 2, 2 ) + str2 . substr ( 0, len - 2 );
    clock_rot = clock_rot + str2 . substr ( 2 ) + str2 . substr ( 0, 2 );
    return ( str1 . compare ( clock_rot ) == 0 || str1 . compare ( anticlock_rot ) == 0 );
  }
question_info.test_list: [{"idx": 0, "outputs": true, "inputs": {"str1": "amazon", "str2": "azonam"}}, {"idx": 1, "outputs": true, "inputs": {"str1": "onamaz", "str2": "amazon"}}, {"idx": 2, "outputs": false, "inputs": {"str1": "amazon", "str2": "azoman"}}, {"idx": 3, "outputs": true, "inputs": {"str1": "ab", "str2": "ab"}}, {"idx": 4, "outputs": false, "inputs": {"str1": "737009", "str2": "239119"}}, {"idx": 5, "outputs": false, "inputs": {"str1": "000110", "str2": "01111"}}, {"idx": 6, "outputs": false, "inputs": {"str1": "l", "str2": "YVo hqvnGxow"}}, {"idx": 7, "outputs": false, "inputs": {"str1": "4420318628", "str2": "52856"}}, {"idx": 8, "outputs": false, "inputs": {"str1": "11011111000000", "str2": "10"}}, {"idx": 9, "outputs": false, "inputs": {"str1": " pvFHANc", "str2": "xBIDFbiGb"}}]
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(str1: String, str2: String, expected:Boolean):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(str1, str2), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver("amazon", "azonam", true)
      println("TEST-0...${result}")
      
      result = driver("onamaz", "amazon", true)
      println("TEST-1...${result}")
      
      result = driver("amazon", "azoman", false)
      println("TEST-2...${result}")
      
      result = driver("ab", "ab", true)
      println("TEST-3...${result}")
      
      result = driver("737009", "239119", false)
      println("TEST-4...${result}")
      
      result = driver("000110", "01111", false)
      println("TEST-5...${result}")
      
      result = driver("l", "YVo hqvnGxow", false)
      println("TEST-6...${result}")
      
      result = driver("4420318628", "52856", false)
      println("TEST-7...${result}")
      
      result = driver("11011111000000", "10", false)
      println("TEST-8...${result}")
      
      result = driver(" pvFHANc", "xBIDFbiGb", false)
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: checkStringCanObtainedRotatingAnotherString2Places
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