title: Check Given String Can Split Four Distinct Strings
signature: check_given_string_can_split_four_distinct_strings <- function(s) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(s, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(s), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          "WKTj Nw", 
          FALSE
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          "8235021", 
          FALSE
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          "0101", 
          FALSE
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          "BLMhiQsQcFla", 
          TRUE
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          "00363175722", 
          TRUE
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          "10000", 
          FALSE
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          "aqEYWNd bqgye", 
          TRUE
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          "83", 
          FALSE
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          "000011110111", 
          TRUE
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          "E", 
          FALSE
      )))
  
  }
  
  main()
source_py: def check_given_string_can_split_four_distinct_strings(s):
      if (len(s) >= 10):
          return True
      for i in range(1, len(s)):
          for j in range((i + 1), len(s)):
              for k in range((j + 1), len(s)):
                  s1 = s[0:i]
                  s2 = s[i:(j - i)]
                  s3 = s[j:(k - j)]
                  s4 = s[k:(len(s) - k)]
                  if ((s1 != s2) and (s1 != s3) and (s1 != s4) and (s2 != s3) and (s2 != s4) and (s3 != s4)):
                      return True
      return False
source_cpp: bool check_given_string_can_split_four_distinct_strings(string s) {
    if ( s . size ( ) >= 10 ) return true;
    for ( int i = 1;
    i < s . size ( );
    i ++ ) {
      for ( int j = i + 1;
      j < s . size ( );
      j ++ ) {
        for ( int k = j + 1;
        k < s . size ( );
        k ++ ) {
          string s1 = s . substr ( 0, i );
          string s2 = s . substr ( i, j - i );
          string s3 = s . substr ( j, k - j );
          string s4 = s . substr ( k, s . size ( ) - k );
          if ( s1 != s2 && s1 != s3 && s1 != s4 && s2 != s3 && s2 != s4 && s3 != s4 ) return true;
        }
      }
    }
    return false;
  }