Files
java-interview-lab/disarium-number/README.md
T

880 B

disarium-number

Disarium number checks in plain Java 25: the original Math.pow loop, an integer-power loop, a String version, a Streams version and a log10 digit-count variant. A test proves they agree, and output/ holds the transcripts quoted in the post. Companion to Disarium Number in Java: Program, Algorithm and All Disarium Numbers from 1 to 1000.

Versions

Component Version
JDK 25.0.5+8 (Temurin LTS), --release 25
JUnit Jupiter 6.1.3
Maven 3.9.11

Run it

cd disarium-number
./scripts/run.sh check        # also: list | dryrun | approaches | digits | count
mvn test                      # 6 tests
./scripts/run-all.sh          # regenerates output/*.txt (count takes ~2 minutes)

count brute-forces every int up to 10^8; the timing depends on your machine.