title: Check String Can Obtained Rotating Another String 2 Places
signature: pub fn check_string_can_obtained_rotating_another_string_2_places(str1: String, str2: String) -> bool {
test_code: use std::collections::HashMap;
  use std::collections::HashSet;
  use std::cmp::*;
  use std::collections::*;
  use std::fmt::*; 
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  pub fn validate_solution(actual: bool, expected: bool)->bool{
  return actual==expected
  }
  pub fn driver(str1: String, str2: String, expected: bool)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(str1, str2), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        "amazon".to_string(), "azonam".to_string(), 
        true
      ));
      
      println!("TEST-1...{}", driver(
        "onamaz".to_string(), "amazon".to_string(), 
        true
      ));
      
      println!("TEST-2...{}", driver(
        "amazon".to_string(), "azoman".to_string(), 
        false
      ));
      
      println!("TEST-3...{}", driver(
        "ab".to_string(), "ab".to_string(), 
        true
      ));
      
      println!("TEST-4...{}", driver(
        "737009".to_string(), "239119".to_string(), 
        false
      ));
      
      println!("TEST-5...{}", driver(
        "000110".to_string(), "01111".to_string(), 
        false
      ));
      
      println!("TEST-6...{}", driver(
        "l".to_string(), "YVo hqvnGxow".to_string(), 
        false
      ));
      
      println!("TEST-7...{}", driver(
        "4420318628".to_string(), "52856".to_string(), 
        false
      ));
      
      println!("TEST-8...{}", driver(
        "11011111000000".to_string(), "10".to_string(), 
        false
      ));
      
      println!("TEST-9...{}", driver(
        " pvFHANc".to_string(), "xBIDFbiGb".to_string(), 
        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 );
  }