title: Check String Can Obtained Rotating Another String 2 Places
signature: checkStringCanObtainedRotatingAnotherString2Places :: String -> String -> Bool
  checkStringCanObtainedRotatingAnotherString2Places str1 str2 = 
test_code: import Text.Printf
  import Control.Exception (catch, SomeException)
  import Data.Typeable
  import qualified Data.List as List
  import qualified Data.Map as Map
  import qualified Data.Set as Set
  
  -- SOLUTION CODE
  -- ============================================
  
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  validateSolution :: Bool -> Bool -> Bool
  validateSolution actual expected = do
      actual == expected
  
  
  driver :: String -> String -> Bool -> String
  driver str1 str2 expected = do
      if (validateSolution (PLACEHOLDER_FN_NAME str1 str2) expected)
          then "PASSED"
      else "FAILED"
  
  main = do
      printf "TEST-0...%s\n" (driver ("amazon") ("azonam") (True) )
  
      printf "TEST-1...%s\n" (driver ("onamaz") ("amazon") (True) )
  
      printf "TEST-2...%s\n" (driver ("amazon") ("azoman") (False) )
  
      printf "TEST-3...%s\n" (driver ("ab") ("ab") (True) )
  
      printf "TEST-4...%s\n" (driver ("737009") ("239119") (False) )
  
      printf "TEST-5...%s\n" (driver ("000110") ("01111") (False) )
  
      printf "TEST-6...%s\n" (driver ("l") ("YVo hqvnGxow") (False) )
  
      printf "TEST-7...%s\n" (driver ("4420318628") ("52856") (False) )
  
      printf "TEST-8...%s\n" (driver ("11011111000000") ("10") (False) )
  
      printf "TEST-9...%s\n" (driver (" pvFHANc") ("xBIDFbiGb") (False) )
  
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 );
  }