Episode 7 — DSA with JavaScript / 7.7 — Math Problems and Algorithms

7.7 — Exercise Questions: Math Problems

<< Overview


Easy

E1. Check Prime

Solution (JS)
function isPrime(n) {
    if (n < 2) return false;
    for (let i = 2; i * i <= n; i++) if (n % i === 0) return false;
    return true;
}

E2. GCD of Two Numbers

Solution (JS)
function gcd(a, b) { while (b) { [a,b]=[b,a%b]; } return a; }

E3. Factorial

Solution (JS)
function fact(n) { let r=1; for(let i=2;i<=n;i++) r*=i; return r; }

E4. Check Armstrong Number

Solution (JS)
function isArmstrong(n) {
    const d=String(n).split("").map(Number), p=d.length;
    return d.reduce((s,x)=>s+x**p,0)===n;
}

E5. Sum of Digits

Solution (JS)
function digitSum(n) { let s=0; n=Math.abs(n); while(n>0){s+=n%10;n=Math.floor(n/10);} return s; }

Medium

E6. Sieve of Eratosthenes

Solution (JS)
function sieve(n){const p=Array(n+1).fill(true);p[0]=p[1]=false;for(let i=2;i*i<=n;i++)if(p[i])for(let j=i*i;j<=n;j+=i)p[j]=false;return p.reduce((a,v,i)=>v?[...a,i]:a,[]);}

E7. Fast Exponentiation

Solution (JS)
function fastPow(b,e){if(e===0)return 1;if(e%2===0){const h=fastPow(b,e/2);return h*h;}return b*fastPow(b,e-1);}

E8. Count Trailing Zeros in N!

Solution (JS)
function trailingZeros(n){let c=0;while(n>=5){n=Math.floor(n/5);c+=n;}return c;}

E9. Prime Factorization

Solution (JS)
function factors(n){const f=[];for(let d=2;d*d<=n;d++)while(n%d===0){f.push(d);n/=d;}if(n>1)f.push(n);return f;}

E10. nCr Computation

Solution (JS)
function nCr(n,r){if(r>n-r)r=n-r;let res=1;for(let i=0;i<r;i++){res*=(n-i);res/=(i+1);}return res;}

Hard

E11. Modular Exponentiation

Solution (JS)
function modPow(b,e,m){let r=1n;b=BigInt(b)%BigInt(m);e=BigInt(e);m=BigInt(m);while(e>0n){if(e%2n===1n)r=r*b%m;e/=2n;b=b*b%m;}return Number(r);}

E12. Euler's Totient

Solution (JS)
function totient(n){let res=n;for(let p=2;p*p<=n;p++){if(n%p===0){while(n%p===0)n/=p;res-=res/p;}}if(n>1)res-=res/n;return res;}

E13. Count Primes in Range [L, R]

Solution (JS)
function countPrimesRange(l,r){const primes=sieve(r);return primes.filter(p=>p>=l).length;}

Additional exercise bank

EX-014

  • Problem: Math exercise #14.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-015

  • Problem: Math exercise #15.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-016

  • Problem: Math exercise #16.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-017

  • Problem: Math exercise #17.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-018

  • Problem: Math exercise #18.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-019

  • Problem: Math exercise #19.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-020

  • Problem: Math exercise #20.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-021

  • Problem: Math exercise #21.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-022

  • Problem: Math exercise #22.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-023

  • Problem: Math exercise #23.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-024

  • Problem: Math exercise #24.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-025

  • Problem: Math exercise #25.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-026

  • Problem: Math exercise #26.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-027

  • Problem: Math exercise #27.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-028

  • Problem: Math exercise #28.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-029

  • Problem: Math exercise #29.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-030

  • Problem: Math exercise #30.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-031

  • Problem: Math exercise #31.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-032

  • Problem: Math exercise #32.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-033

  • Problem: Math exercise #33.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-034

  • Problem: Math exercise #34.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-035

  • Problem: Math exercise #35.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-036

  • Problem: Math exercise #36.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-037

  • Problem: Math exercise #37.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-038

  • Problem: Math exercise #38.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-039

  • Problem: Math exercise #39.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-040

  • Problem: Math exercise #40.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-041

  • Problem: Math exercise #41.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-042

  • Problem: Math exercise #42.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-043

  • Problem: Math exercise #43.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-044

  • Problem: Math exercise #44.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-045

  • Problem: Math exercise #45.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-046

  • Problem: Math exercise #46.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-047

  • Problem: Math exercise #47.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-048

  • Problem: Math exercise #48.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-049

  • Problem: Math exercise #49.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-050

  • Problem: Math exercise #50.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-051

  • Problem: Math exercise #51.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-052

  • Problem: Math exercise #52.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-053

  • Problem: Math exercise #53.
  • Difficulty: Easy
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-054

  • Problem: Math exercise #54.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-055

  • Problem: Math exercise #55.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-056

  • Problem: Math exercise #56.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-057

  • Problem: Math exercise #57.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-058

  • Problem: Math exercise #58.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-059

  • Problem: Math exercise #59.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-060

  • Problem: Math exercise #60.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-061

  • Problem: Math exercise #61.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-062

  • Problem: Math exercise #62.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-063

  • Problem: Math exercise #63.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-064

  • Problem: Math exercise #64.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-065

  • Problem: Math exercise #65.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-066

  • Problem: Math exercise #66.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-067

  • Problem: Math exercise #67.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-068

  • Problem: Math exercise #68.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-069

  • Problem: Math exercise #69.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-070

  • Problem: Math exercise #70.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-071

  • Problem: Math exercise #71.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-072

  • Problem: Math exercise #72.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-073

  • Problem: Math exercise #73.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-074

  • Problem: Math exercise #74.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-075

  • Problem: Math exercise #75.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-076

  • Problem: Math exercise #76.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-077

  • Problem: Math exercise #77.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-078

  • Problem: Math exercise #78.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-079

  • Problem: Math exercise #79.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-080

  • Problem: Math exercise #80.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-081

  • Problem: Math exercise #81.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-082

  • Problem: Math exercise #82.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-083

  • Problem: Math exercise #83.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-084

  • Problem: Math exercise #84.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-085

  • Problem: Math exercise #85.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-086

  • Problem: Math exercise #86.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-087

  • Problem: Math exercise #87.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-088

  • Problem: Math exercise #88.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-089

  • Problem: Math exercise #89.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-090

  • Problem: Math exercise #90.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-091

  • Problem: Math exercise #91.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-092

  • Problem: Math exercise #92.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-093

  • Problem: Math exercise #93.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-094

  • Problem: Math exercise #94.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-095

  • Problem: Math exercise #95.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-096

  • Problem: Math exercise #96.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-097

  • Problem: Math exercise #97.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-098

  • Problem: Math exercise #98.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-099

  • Problem: Math exercise #99.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-100

  • Problem: Math exercise #100.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-101

  • Problem: Math exercise #101.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-102

  • Problem: Math exercise #102.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-103

  • Problem: Math exercise #103.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-104

  • Problem: Math exercise #104.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-105

  • Problem: Math exercise #105.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-106

  • Problem: Math exercise #106.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-107

  • Problem: Math exercise #107.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-108

  • Problem: Math exercise #108.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-109

  • Problem: Math exercise #109.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-110

  • Problem: Math exercise #110.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-111

  • Problem: Math exercise #111.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-112

  • Problem: Math exercise #112.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-113

  • Problem: Math exercise #113.
  • Difficulty: Medium
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-114

  • Problem: Math exercise #114.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-115

  • Problem: Math exercise #115.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-116

  • Problem: Math exercise #116.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-117

  • Problem: Math exercise #117.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-118

  • Problem: Math exercise #118.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-119

  • Problem: Math exercise #119.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-120

  • Problem: Math exercise #120.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-121

  • Problem: Math exercise #121.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-122

  • Problem: Math exercise #122.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-123

  • Problem: Math exercise #123.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-124

  • Problem: Math exercise #124.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-125

  • Problem: Math exercise #125.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-126

  • Problem: Math exercise #126.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-127

  • Problem: Math exercise #127.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-128

  • Problem: Math exercise #128.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-129

  • Problem: Math exercise #129.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-130

  • Problem: Math exercise #130.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-131

  • Problem: Math exercise #131.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-132

  • Problem: Math exercise #132.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-133

  • Problem: Math exercise #133.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-134

  • Problem: Math exercise #134.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-135

  • Problem: Math exercise #135.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-136

  • Problem: Math exercise #136.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-137

  • Problem: Math exercise #137.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-138

  • Problem: Math exercise #138.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-139

  • Problem: Math exercise #139.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-140

  • Problem: Math exercise #140.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-141

  • Problem: Math exercise #141.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-142

  • Problem: Math exercise #142.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-143

  • Problem: Math exercise #143.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-144

  • Problem: Math exercise #144.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-145

  • Problem: Math exercise #145.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-146

  • Problem: Math exercise #146.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-147

  • Problem: Math exercise #147.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-148

  • Problem: Math exercise #148.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-149

  • Problem: Math exercise #149.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-150

  • Problem: Math exercise #150.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-151

  • Problem: Math exercise #151.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-152

  • Problem: Math exercise #152.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-153

  • Problem: Math exercise #153.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-154

  • Problem: Math exercise #154.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-155

  • Problem: Math exercise #155.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-156

  • Problem: Math exercise #156.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-157

  • Problem: Math exercise #157.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-158

  • Problem: Math exercise #158.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-159

  • Problem: Math exercise #159.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-160

  • Problem: Math exercise #160.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-161

  • Problem: Math exercise #161.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-162

  • Problem: Math exercise #162.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.

EX-163

  • Problem: Math exercise #163.
  • Difficulty: Hard
  • Skills: Number theory, modular arithmetic, digit manipulation.
  • Implementation: Both JS and C++.