title: Check If A Number Is Jumbled Or Not
signature: checkIfANumberIsJumbledOrNot(num) {
test_code: import 'dart:convert';
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  bool validateSolution(bool actual, bool expected){
      return actual.toString() == expected.toString();
  }
  
  String driver(num, bool expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(num), expected)){
              return "PASSED";
          }
          return "FAILED";
      }catch(exception_object){
          return exception_object.runtimeType.toString();
      }
  }
  
  int main() {
  
      print("TEST-0...${driver(
          67, 
          true)
      }");
  
      print("TEST-1...${driver(
          77, 
          true)
      }");
  
      print("TEST-2...${driver(
          35, 
          false)
      }");
  
      print("TEST-3...${driver(
          79, 
          false)
      }");
  
      print("TEST-4...${driver(
          45, 
          true)
      }");
  
      print("TEST-5...${driver(
          22, 
          true)
      }");
  
      print("TEST-6...${driver(
          68, 
          false)
      }");
  
      print("TEST-7...${driver(
          17, 
          false)
      }");
  
      print("TEST-8...${driver(
          5, 
          true)
      }");
  
      print("TEST-9...${driver(
          85, 
          false)
      }");
  
      return 0;
  }
source_py: def check_if_a_number_is_jumbled_or_not(num):
      if ((num // 10) == 0):
          return True
      while (num != 0):
          if ((num // 10) == 0):
              return True
          digit1 = (num % 10)
          digit2 = ((num // 10) % 10)
          if (abs((digit2 - digit1)) > 1):
              return False
          num = (num // 10)
      return True
source_cpp: bool check_if_a_number_is_jumbled_or_not(int num) {
    if ( num / 10 == 0 ) return true;
    while ( num != 0 ) {
      if ( num / 10 == 0 ) return true;
      int digit1 = num % 10;
      int digit2 = ( num / 10 ) % 10;
      if ( abs ( digit2 - digit1 ) > 1 ) return false;
      num = num / 10;
    }
    return true;
  }