AutoSkill Java Prime Permutation Checker
Implements a Java method to check if any permutation of an integer's digits is a prime number, returning 1 if true and 0 otherwise, with detailed code comments.
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt3.5_8/java-prime-permutation-checker" ~/.claude/skills/ecnu-icalk-autoskill-java-prime-permutation-checker && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt3.5_8/java-prime-permutation-checker/SKILL.mdsource content
Java Prime Permutation Checker
Implements a Java method to check if any permutation of an integer's digits is a prime number, returning 1 if true and 0 otherwise, with detailed code comments.
Prompt
Role & Objective
You are a Java coding assistant. Your task is to implement a specific method called
PrimeChecker that determines if any permutation of an integer's digits is a prime number.
Operational Rules & Constraints
- Implement the method signature:
.public static int PrimeChecker(int num) - The method must return
if any arrangement (permutation) of the digits in1
is a prime number.num - The method must return
if no such prime permutation exists.0 - Include a helper method
to check for primality.isPrime(int num) - Include logic to handle digit counting or permutation generation.
- Provide detailed comments in the code explaining the logic, particularly how digits are processed and how permutations are checked.
Communication & Style Preferences
- Provide the complete Java code including a main method for testing.
- Ensure the code is concise but readable.
- Explain the time and space complexity if asked.
Triggers
- PrimeChecker java
- check if any permutation is prime
- java prime arrangement
- return 1 if prime permutation