giulio98/xlcost-single-prompt huggingface dataset:
# find sum of even index binomial coefficients | python program to find sum of even index term ; return the sum of even index term ; calculate value of binomial coefficient in bottom up manner ; base cases ; calculate value using previously stored values ; finding sum of even index term ; 

import math


def evenSum(n):
    C = [[0 for x in range(n + 1)]for y in range(n + 1)]
    for i in range(0, n + 1):
        for j in range(0, min(i, n + 1)):
            if j == 0 or j == i:
                C[i][j] = 1
            else:
                C[i][j] = C[i - 1][j - 1] + C[i - 1][j]
    sum = 0
    for i in range(0, n + 1):
        if n % 2 == 0:
            sum = sum + C[n][i]
    return sum


n = 4
print(evenSum(n))

# Expected output:
8
# program to print triangular number series till n | function to find triangular number ; 
def triangular_series(n):
    for i in range(1, n + 1):
        print(i * (i + 1) // 2, end=' ')


n = 5
triangular_series(n)

# Expected output:
1 3 6 10 15
# check if a number can be written as sum of three consecutive integers | function to check if a number can be written as sum of three consecutive integers . ; if n is multiple of 3 ; else print " - 1" . ; 
def checksum(n):
    n = int(n)
    if n % 3 == 0:
        print(int(n / 3 - 1), " ", int(n / 3), " ", int(n / 3 + 1))
    else:
        print("-1")


n = 6
checksum(n)

# Expected output:
1   2   3
# sum of all divisors from 1 to n | python3 code to find sum of all divisor of number up to 'n ; utility function to find sum of all divisor of number up to 'n ; 
def divisorSum(n):
    sum = 0
    for i in range(1, n + 1):
        sum += int(n / i) * i
    return int(sum)


n = 4
print(divisorSum(n))
n = 5
print(divisorSum(n))

# Expected output:
15
21
# sum of all divisors from 1 to n |  ; t1 = i * ( num / i - i + 1 ) adding i every time it appears with numbers greater than or equal to itself t2 = ( ( ( num / i ) * ( num / i + 1 ) ) / 2 ) - ( ( i * ( i + 1 ) ) / 2 ) adding numbers that appear with i and are greater than i ; 

import math


def sum_all_divisors(num):
    sum = 0
    for i in range(1, math .floor(math .sqrt(num)) + 1):
        t1 = i * (num / i - i + 1)
        t2 = (((num / i) * (num / i + 1)) / 2) - ((i * (i + 1)) / 2)
        sum += t1 + t2
    return sum


n = 1
sum = sum_all_divisors(n)
print(sum)

# Expected output:
1.0
# n |  ; function to find nth polite number ; 

import math


def Polite(n):
    n = n + 1
    return (int)(n + (math .log((n + math .log(n, 2)), 2)))


n = 7
print(Polite(n))

# Expected output:
11
# find the number of stair steps | modified binary search function to solve the equation ; if mid is solution to equation ; if our solution to equation lies between mid and mid - 1 ; if solution to equation is greater than mid ; if solution to equation is less than mid ; 
def solve(low, high, T):
    while low <= high:
        mid = int((low + high) / 2)
        if (mid * (mid + 1)) == T:
            return mid
        if (mid > 0 and (mid * (mid + 1)) > T and (mid * (mid - 1)) <= T):
            return mid - 1
        if (mid * (mid + 1)) > T:
            high = mid - 1
        else:
            low = mid + 1
    return -1


T = 15
ans = solve(1, T, 2 * T)
if ans != -1:
    ans -= 1
print("Number of stair steps = ", ans)

# Expected output:
Number of stair steps =  4
# check for integer overflow on multiplication | function to check whether there is overflow in a * b or not . it returns true if there is overflow . ; check if either of them is zero ; 
def isOverflow(a, b):
    if (a == 0 or b == 0):
        return False
    result = a * b
    if (result >= 9223372036854775807 or result <= -9223372036854775808):
        result = 0
    if (a == (result // b)):
        print(result // b)
        return False
    else:
        return True


if __name__ == "__main__":
    a = 10000000000
    b = -10000000000
    if (isOverflow(a, b)):
        print("Yes")
    else:
        print("No")

# Expected output:
Yes
# sum of first n odd numbers in o ( 1 ) complexity | python3 program to find sum of first n odd numbers ; returns the sum of first n odd numbers ; 
def oddSum(n):
    sum = 0
    curr = 1
    i = 0
    while i < n:
        sum = sum + curr
        curr = curr + 2
        i = i + 1
    return sum


n = 20
print(" Sum of first", n, "Odd Numbers is: ", oddSum(n))

# Expected output:
 Sum of first 20 Odd Numbers is:  400
# sum of first n odd numbers in o ( 1 ) complexity | returns the sum of first n odd numbers ; 
def oddSum(n):
    return (n * n)


n = 20
print(" Sum of first", n, "Odd Numbers is: ", oddSum(n))

# Expected output:
 Sum of first 20 Odd Numbers is:  400
# k | returns the sum of first n odd numbers ; count prime factors of all numbers till b . ; print all numbers with k prime factors ; 
def printKPFNums(A, B, K):
    prime = [True] * (B + 1)
    p_factors = [0] * (B + 1)
    for p in range(2, B + 1):
        if (p_factors[p] == 0):
            for i in range(p, B + 1, p):
                p_factors[i] = p_factors[i] + 1
    for i in range(A, B + 1):
        if (p_factors[i] == K):
            print(i, end=" ")


A = 14
B = 18
K = 2
printKPFNums(A, B, K)

# Expected output:
14 15 18
# sum of the series 1 + x / 1 + x ^ 2 / 2 + x ^ 3 / 3 + . . + x ^ n / n | function to print the sum of the series ; 
def SUM(x, n):
    total = 1
    for i in range(1, n + 1):
        total = total + ((x ** i) / i)
    return total


x = 2
n = 5
s = SUM(x, n)
print(round(s, 2))

# Expected output:
18.07
# find if a number is part of ap whose first element and difference are given | '' returns yes if exist else no.  ; if difference is 0 , then x must be same as a . ; else difference between x and a must be divisible by d . ; 
def isMember(a, d, x):
    if d == 0:
        return x == a
    return ((x - a) % d == 0 and int((x - a) / d) >= 0)


a = 1
x = 7
d = 3
if isMember(a, d, x):
    print("Yes")
else:
    print("No")

# Expected output:
Yes
# number of gp ( geometric progression ) subsequences of size 3 | python3 program to count gp subsequences of size 3. ; to calculate ncr dp approach ; nc0 is 1 ; compute next row of pascal triangle using the previous row ; returns count of g . p . subsequences with length 3 and common ratio r ; hashing to maintain left and right array elements to the main count ; stores the answer ; traverse through the elements ; if ratio is one ; traverse the count in hash ; calculating nc3 , where ' n ' is the number of times each number is repeated in the input ; traverse through all elements and find out the number of elements as k1 * k2 ; keep the count of left and right elements left is a [ i ] / r and right a [ i ] * r ; if the current element is divisible by k , count elements in left hash . ; decrease the count in right hash ; number of right elements ; calculate the answer ; left count of a [ i ] ; returns answer ; 

from collections import defaultdict


def binomialCoeff(n, k):

    C = [0] * (k + 1)

    C[0] = 1

    for i in range(1, n + 1):
        for j in range(min(i, k), -1, -1):
            C[j] = C[j] + C[j - 1]
    return C[k]


def subsequences(a, n, r):
    left = defaultdict(int)
    right = defaultdict(int)
    ans = 0
    for i in range(n):
        right[a[i]] += 1
    if (r == 1):

        for i in right:
            ans += binomialCoeff(right[i], 3)

        return ans
    for i in range(n):
        c1 = 0
        c2 = 0
        if (a[i] % r == 0):
            c1 = left[a[i] // r]
        right[a[i]] -= 1
        c2 = right[a[i] * r]
        ans += c1 * c2
        left[a[i]] += 1
    return ans


if __name__ == "__main__":
    a = [1, 2, 6, 2, 3, 6, 9, 18, 3, 9]
    n = len(a)
    r = 3
    print(subsequences(a, n, r))

# Expected output:
6
# check whether a number can be represented by sum of two squares | function to check if there exist two numbers sum of whose squares is n . ; 
def sumSquare(n):
    i = 1
    while i * i <= n:
        j = 1
        while (j * j <= n):
            if (i * i + j * j == n):
                print(i, "^2 + ", j, "^2")
                return True
            j = j + 1
        i = i + 1
    return False


n = 25
if (sumSquare(n)):
    print("Yes")
else:
    print("No")

# Expected output:
3 ^2 +  4 ^2
Yes
# queries to count minimum flips required to fill a binary submatrix with 0 s only | python3 program for the above approach ; function to compute the matrix prefixcnt [ m ] [ n ] from mat [ m ] [ n ] such that prefixcnt [ i ] [ j ] stores the count of 0 's from (0, 0) to (i, j) ; initialize prefixcnt [ i ] [ j ] with 1 if mat [ i ] [ j ] is 0 ; otherwise , assign with 0 ; calculate prefix sum for each row ; calculate prefix sum for each column ; function to compute count of 0 's in submatrix from (pi, pj) to (qi, qj) from prefixcnt[m][n] ; initialize that count of 0 's  in the sub-matrix within  indices (0, 0) to (qi, qj) ; subtract count of 0 's within  indices (0, 0) and (pi-1, qj) ; subtract count of 0 's within  indices (0, 0) and (qi, pj-1) ; add prefixcnt [ pi - 1 ] [ pj - 1 ] because its value has been added once but subtracted twice ; function to count the 0 s in the each given submatrix ; stores the prefix sum of each row and column ; compute matrix prefixcnt [ ] [ ] ; function call for each query ; 

M = 6
N = 7


def preCompute(mat, prefixCnt):
    for i in range(M):
        for j in range(N):
            if (mat[i][j] == 0):
                prefixCnt[i][j] = 1
            else:
                prefixCnt[i][j] = 0
    for i in range(M):
        for j in range(1, N):
            prefixCnt[i][j] += prefixCnt[i][j - 1]
    for i in range(1, M):
        for j in range(N):
            prefixCnt[i][j] += prefixCnt[i - 1][j]
    return prefixCnt


def countQuery(prefixCnt, pi, pj, qi, qj):
    cnt = prefixCnt[qi][qj]
    if (pi > 0):
        cnt -= prefixCnt[pi - 1][qj]
    if (pj > 0):
        cnt -= prefixCnt[qi][pj - 1]
    if (pi > 0 and pj > 0):
        cnt += prefixCnt[pi - 1][pj - 1]
    return cnt


def count0s(mat, Q, sizeQ):
    prefixCnt = [[0 for i in range(N)]for i in range(M)]
    prefixCnt = preCompute(mat, prefixCnt)
    for i in range(sizeQ):
        print(
            countQuery(
                prefixCnt,
                Q[i][0],
                Q[i][1],
                Q[i][2],
                Q[i][3]),
            end=" ")


if __name__ == '__main__':
    mat = [[0, 1, 0, 1, 1, 1, 0], [1, 0, 1, 1, 1, 0, 1], [1, 1, 0, 0, 1, 1, 0], [
        1, 1, 1, 1, 1, 0, 1], [0, 0, 1, 0, 1, 1, 1], [1, 1, 0, 1, 1, 0, 1]]
    Q = [[0, 1, 3, 2], [2, 2, 4, 5], [4, 3, 5, 6]]
    sizeQ = len(Q)
    count0s(mat, Q, sizeQ)

# Expected output:
3 4 2
# smallest root of the equation x ^ 2 + s ( x ) * x | python3 program to find smallest value of root of an equation under given constraints . ; function to check if the sum of digits is equal to the summation assumed ; calculate the sum of digit ; function to find the largest root possible . ; iterate for all possible sum of digits . ; check if discriminent is a perfect square . ; check if discriminent is a perfect square and if it as perefect root of the equation ; function returns answer ; 

import math


def check(a, b):
    c = 0
    while (a != 0):
        c = c + a % 10
        a = int(a / 10)
    return True if (c == b)else False


def root(n):
    found = False
    mx = 1000000000000000001
    for i in range(91):
        s = i * i + 4 * n
        sq = int(math .sqrt(s))
        if (sq * sq == s and check(int((sq - i) / 2), i)):
            found = True
            mx = min(mx, int((sq - i) / 2))
    if (found):
        return mx
    else:
        return -1


n = 110
print(root(n))

# Expected output:
10
# sum of digits of a given number to a given power | function to calculate sum ; 
def calculate(n, power):
    return sum([int(i)for i in str(pow(n, power))])


n = 5
power = 4
print(calculate(n, power))

# Expected output:
13
# co | python3 program to represent a number as sum of a co - prime pair such that difference between them is minimum ; function to check if pair is co - prime or not ; function to find and print co - prime pair ; 

import math


def coprime(a, b):
    return 1 if (math .gcd(a, b) == 1)else 0


def pairSum(n):
    mid = int(n / 2)
    i = mid
    while (i >= 1):
        if (coprime(i, n - i) == 1):
            print(i, n - i)
            break
        i = i - 1


n = 11
pairSum(n)

# Expected output:
5 6
# program for quotient and remainder of big number | function to calculate the modulus ; store the modulus of big number ; do step by step division ; update modulo by concatenating current digit . ; update quotient ; update mod for next iteration . ; flag used to remove starting zeros ; 
def modBigNumber(num, m):
    vec = []
    mod = 0
    for i in range(0, len(num), 1):
        digit = ord(num[i]) - ord('0')
        mod = mod * 10 + digit
        quo = int(mod / m)
        vec .append(quo)
        mod = mod % m
    print("Remainder :", mod)
    print("Quotient :", end=" ")
    zeroflag = 0
    for i in range(0, len(vec), 1):
        if (vec[i] == 0 and zeroflag == 0):
            continue
        zeroflag = 1
        print(vec[i], end="")
    return


if __name__ == '__main__':
    num = "14598499948265358486"
    m = 487
    modBigNumber(num, m)

# Expected output:
Remainder : 430
Quotient : 29976385930729688
# queries to find whether a number has exactly four distinct factors or not | initialize global variable according to given condition so that it can be accessible to all function ; function to calculate all number having four distinct factors ; create a boolean array " prime [ 0 . . n ] " and initialize all entries it as true . a value in prime [ i ] will finally be false if i is not a prime , else true . ; if prime [ p ] is not changed , then it is a prime ; update all multiples of p ; initialize prime [ ] array which will contain all the primes from 1 - n ; iterate over all the prime numbers ; mark cube root of prime numbers ; mark product of prime numbers ; 

N = 1000001
fourDiv = [False] * (N + 1)


def fourDistinctFactors():
    primeAll = [True] * (N + 1)
    p = 2
    while (p * p <= N):
        if (primeAll[p]):
            i = p * 2
            while (i <= N):
                primeAll[i] = False
                i += p
        p += 1
    prime = []
    for p in range(2, N + 1):
        if (primeAll[p]):
            prime .append(p)
    for i in range(len(prime)):
        p = prime[i]
        if (1 * p * p * p <= N):
            fourDiv[p * p * p] = True
        for j in range(i + 1, len(prime)):
            q = prime[j]
            if (1 * p * q > N):
                break
            fourDiv[p * q] = True


fourDistinctFactors()
num = 10
if (fourDiv[num]):
    print("Yes")
else:
    print("No")
num = 12
if (fourDiv[num]):
    print("Yes")
else:
    print("No")

# Expected output:
Yes
No
# leonardo number | a simple recursive program to find n - th leonardo number . ; 
def leonardo(n):
    dp = []
    dp .append(1)
    dp .append(1)
    for i in range(2, n + 1):
        dp .append(dp[i - 1] + dp[i - 2] + 1)
    return dp[n]


print(leonardo(3))

# Expected output:
5
# cholesky decomposition : matrix decomposition | python3 program to decompose a matrix using cholesky decomposition ; decomposing a matrix into lower triangular ; summation for diagonals ; evaluating l ( i , j ) using l ( j , j ) ; displaying lower triangular and its transpose ; lower triangular ; transpose of lower triangular ; 

import math
MAX = 100


def Cholesky_Decomposition(matrix, n):
    lower = [[0 for x in range(n + 1)]for y in range(n + 1)]
    for i in range(n):
        for j in range(i + 1):
            sum1 = 0
            if (j == i):
                for k in range(j):
                    sum1 += pow(lower[j][k], 2)
                lower[j][j] = int(math .sqrt(matrix[j][j] - sum1))
            else:
                for k in range(j):
                    sum1 += (lower[i][k] * lower[j][k])
                if (lower[j][j] > 0):
                    lower[i][j] = int((matrix[i][j] - sum1) / lower[j][j])
    print("Lower TriangularTABSYMBOLTABSYMBOLTranspose")
    for i in range(n):
        for j in range(n):
            print(lower[i][j], end="TABSYMBOL")
        print("", end="TABSYMBOL")
        for j in range(n):
            print(lower[j][i], end="TABSYMBOL")
        print("")


n = 3
matrix = [[4, 12, -16], [12, 37, -43], [-16, -43, 98]]
Cholesky_Decomposition(matrix, n)

# Expected output:
Lower TriangularTABSYMBOLTABSYMBOLTranspose
2TABSYMBOL0TABSYMBOL0TABSYMBOLTABSYMBOL2TABSYMBOL6TABSYMBOL-8TABSYMBOL
6TABSYMBOL1TABSYMBOL0TABSYMBOLTABSYMBOL0TABSYMBOL1TABSYMBOL5TABSYMBOL
-8TABSYMBOL5TABSYMBOL3TABSYMBOLTABSYMBOL0TABSYMBOL0TABSYMBOL3TABSYMBOL
# program for sum of arithmetic series | python3 efficient solution to find sum of arithmetic series . ; 
def sumOfAP(a, d, n):
    sum = (n / 2) * (2 * a + (n - 1) * d)
    return sum


n = 20
a = 2.5
d = 1.5
print(sumOfAP(a, d, n))

# Expected output:
335.0
# program for cube sum of first n natural numbers | returns the sum of series ; 
def sumOfSeries(n):
    x = 0
    if n % 2 == 0:
        x = (n / 2) * (n + 1)
    else:
        x = ((n + 1) / 2) * n
    return (int)(x * x)


n = 5
print(sumOfSeries(n))

# Expected output:
225
# maximum value of | arr [ i ] | return maximum value of | arr [ i ] - arr [ j ] | + | i - j | ; iterating two for loop , one for i and another for j . ; evaluating | arr [ i ] - arr [ j ] | + | i - j | and compare with previous maximum . ; 
def findValue(arr, n):
    ans = 0
    for i in range(n):
        for j in range(n):
            ans = ans if ans > (
                abs(arr[i] - arr[j]) + abs(i - j))else (abs(arr[i] - arr[j]) + abs(i - j))
    return ans


arr = [1, 2, 3, 1]
n = len(arr)
print(findValue(arr, n))

# Expected output:
4
# maximum value of | arr [ i ] | return maximum | arr [ i ] - arr [ j ] | + | i - j | ; calculating first_array and second_array ; finding maximum and minimum value in first_array ; storing the difference between maximum and minimum value in first_array ; finding maximum and minimum value in second_array ; storing the difference between maximum and minimum value in second_array ; 
def findValue(arr, n):
    a = []
    b = []
    for i in range(n):
        a .append(arr[i] + i)
        b .append(arr[i] - i)
    x = a[0]
    y = a[0]
    for i in range(n):
        if (a[i] > x):
            x = a[i]
        if (a[i] < y):
            y = a[i]
    ans1 = (x - y)
    x = b[0]
    y = b[0]
    for i in range(n):
        if (b[i] > x):
            x = b[i]
        if (b[i] < y):
            y = b[i]
    ans2 = (x - y)
    return max(ans1, ans2)


if __name__ == '__main__':
    arr = [1, 2, 3, 1]
    n = len(arr)
    print(findValue(arr, n))

# Expected output:
4
# number of subarrays having product less than k | python3 program to count subarrays having product less than k . ; counter for single element ; multiple subarray ; if this multiple is less than k , then increment ; 
def countsubarray(array, n, k):
    count = 0
    for i in range(0, n):
        if array[i] < k:
            count += 1
        mul = array[i]
        for j in range(i + 1, n):
            mul = mul * array[j]
            if mul < k:
                count += 1
            else:
                break
    return count


array = [1, 2, 3, 4]
k = 10
size = len(array)
count = countsubarray(array, size, k)
print(count, end=" ")

# Expected output:
7
# perfect cube factors of a number | function that returns the count of factors that are perfect cube ; to store the count of number of times a prime number divides n ; to store the count of factors that are perfect cube ; count number of 2 's that divides n ; calculate ans according to above formula ; check for all possible numbers that can divide it ; loop to check the number of times prime number i divides it ; calculate ans according to above formula ;  ; 
def noofFactors(N):
    if N == 1:
        return 1
    count = 0
    ans = 1
    while (N % 2 == 0):
        count += 1
        N //= 2
    ans *= ((count // 3) + 1)
    i = 3
    while ((i * i) <= N):
        count = 0
        while (N % i == 0):
            count += 1
            N //= i
        ans *= ((count // 3) + 1)
        i += 2
    return ans


N = 216
print(noofFactors(N))

# Expected output:
4
# digit | function to produce and print digit product sequence ; array which store sequence ; temporary variable to store product ; 
def digit_product_Sum(N):
    a = [0] * (N + 1)
    product = 1
    a[0] = 1
    for i in range(1, N + 1):
        product = int(a[i - 1] / 10)
        if (product == 0):
            product = 1
        else:
            product = a[i - 1] % 10
        val = int(a[i - 1] / 10)
        if (val == 0):
            val = a[i - 1]
        a[i] = a[i - 1] + (val * product)
    for i in range(N):
        print(a[i], end=" ")


N = 10
digit_product_Sum(N)

# Expected output:
1 2 4 8 16 22 26 38 62 74
# geometric mean ( two methods ) | python program to calculate the geometric mean of the given array elements . ; function to calculate geometric mean and return float value . ; declare product variable and initialize it to 1. ; compute the product of all the elements in the array . ; compute geometric mean through formula pow ( product , 1 / n ) and return the value to main function . ; 

import math


def geometricMean(arr, n):
    product = 1
    for i in range(0, n):
        product = product * arr[i]
    gm = (float)(math .pow(product, (1 / n)))
    return (float)(gm)


arr = [1, 2, 3, 4, 5, 6, 7, 8]
n = len(arr)
print('{0:.6f}'.format(geometricMean(arr, n)))

# Expected output:
3.764351
# check whether a number can be expressed as a product of single digit numbers | number of single digit prime numbers ; function to check whether a number can be expressed as a product of single digit numbers ; if ' n ' is a single digit number , then it can be expressed ; define single digit prime numbers array ; repeatedly divide ' n ' by the given prime numbers until all the numbers are used or ' n ' > 1 ; if true , then ' n ' can be expressed ; 

SIZE = 4


def productOfSingelDgt(n):
    if n >= 0 and n <= 9:
        return True
    prime = [2, 3, 5, 7]
    i = 0
    while i < SIZE and n > 1:
        while n % prime[i] == 0:
            n = n / prime[i]
        i += 1
    return n == 1


n = 24
if productOfSingelDgt(n):
    print("Yes")
else:
    print("No")

# Expected output:
Yes
# program to find sum of first n natural numbers | returns sum of first n natural numbers ; 
def findSum(n):
    return n * (n + 1) / 2


n = 5
print(findSum(n))

# Expected output:
15.0
# program to find sum of first n natural numbers | returns sum of first n natural numbers ; if n is odd , ( n + 1 ) must be even ; 
def findSum(n):
    if (n % 2 == 0):
        return (n / 2) * (n + 1)
    else:
        return ((n + 1) / 2) * n


n = 5
print(findSum(n))

# Expected output:
15.0
# maximum number of unique prime factors | return maximum number of prime factors for any number in [ 1 , n ] ; based on sieve of eratosthenes ; if p is prime ; we simply multiply first set of prime numbers while the product is smaller than n . ; 
def maxPrimefactorNum(N):
    if (N < 2):
        return 0
    arr = [True] * (N + 1)
    prod = 1
    res = 0
    p = 2
    while (p * p <= N):
        if (arr[p]):
            for i in range(p * 2, N + 1, p):
                arr[i] = False
            prod *= p
            if (prod > N):
                return res
            res += 1
        p += 1
    return res


N = 500
print(maxPrimefactorNum(N))

# Expected output:
4
# to check a number is palindrome or not without using any extra space | function to check if given number is palindrome or not without using the extra space ; find the appropriate divisor to extract the leading digit ; if first and last digit not same return false ; removing the leading and trailing digit from number ; reducing divisor by a factor of 2 as 2 digits are dropped ; 
def isPalindrome(n):
    divisor = 1
    while (n / divisor >= 10):
        divisor *= 10
    while (n != 0):
        leading = n // divisor
        trailing = n % 10
        if (leading != trailing):
            return False
        n = (n % divisor) // 10
        divisor = divisor / 100
    return True


if (isPalindrome(1001)):
    print('Yes, it is palindrome')
else:
    print('No, not palindrome')

# Expected output:
Yes, it is palindrome