title: Number Is Divisible By 29 Or Not
signature: func numberIsDivisibleBy29OrNot(n int64) 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(n int64, expected bool) string {
      if validateSolution(PLACEHOLDER_FN_NAME(n),expected) {
              return "PASSED"
      }
      return "FAILED"
  
  }
  
  func main() {
  
      // Use imports to avoid undefined errors
      var _ = reflect.DeepEqual
      _ = math.Abs
      _ = sort.Sort
      result := ""
      result = driver(29, true)
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver(0, true)
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver(65, false)
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver(1419, false)
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver(54, false)
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver(7, false)
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver(44, false)
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver(34, false)
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver(1160, true)
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver(292929002929, true)
      fmt.Printf("TEST-9...%s\n", result)
      
          
  }
source_py: def number_is_divisible_by_29_or_not(n):
      while int((n / 100)):
          last_digit = int((n % 10))
          n = int((n / 10))
          n += (last_digit * 3)
      return ((n % 29) == 0)
source_cpp: bool number_is_divisible_by_29_or_not(long long int n) {
    while ( n / 100 ) {
      int last_digit = n % 10;
      n /= 10;
      n += last_digit * 3;
    }
    return ( n % 29 == 0 );
  }