title: Check String Can Obtained Rotating Another String 2 Places
signature: func checkStringCanObtainedRotatingAnotherString2Places(str1 string, str2 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(str1 string, str2 string, expected bool) string {
      if validateSolution(PLACEHOLDER_FN_NAME(str1, str2),expected) {
              return "PASSED"
      }
      return "FAILED"
  
  }
  
  func main() {
  
      // Use imports to avoid undefined errors
      var _ = reflect.DeepEqual
      _ = math.Abs
      _ = sort.Sort
      result := ""
      result = driver("amazon", 
  	"azonam", true)
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver("onamaz", 
  	"amazon", true)
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver("amazon", 
  	"azoman", false)
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver("ab", 
  	"ab", true)
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver("737009", 
  	"239119", false)
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver("000110", 
  	"01111", false)
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver("l", 
  	"YVo hqvnGxow", false)
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver("4420318628", 
  	"52856", false)
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver("11011111000000", 
  	"10", false)
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver(" pvFHANc", 
  	"xBIDFbiGb", false)
      fmt.Printf("TEST-9...%s\n", result)
      
          
  }
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 );
  }