mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2026-03-13 15:21:15 +08:00
chore: Merge pull request #745 from lvlte/ProjectEuler/016
Project Euler - Problem 16
This commit is contained in:
16
Project-Euler/test/Problem016.test.js
Normal file
16
Project-Euler/test/Problem016.test.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import { powerDigitSum } from '../Problem016'
|
||||
|
||||
describe('Check Problem 16 - Power digit sum', () => {
|
||||
it('Power digit sum of 2^15', () => {
|
||||
expect(powerDigitSum(2, 15)).toBe(26)
|
||||
})
|
||||
|
||||
it('Power digit sum of 2^1000', () => {
|
||||
expect(powerDigitSum()).toBe(1366)
|
||||
expect(powerDigitSum(2, 1000)).toBe(1366)
|
||||
})
|
||||
|
||||
it('Power digit sum of 3^5000', () => {
|
||||
expect(powerDigitSum(3, 5000)).toBe(11097)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user