/install algorithm-practice
🎯 Algo Practice - Interactive Algorithm Training
Transform your coding interview preparation with curated algorithm problems, auto-generated code templates, and instant test feedback.
✨ Features
- 📚 100+ Algorithm Problems - Carefully selected from classic interview questions
- 🎚️ Three Difficulty Levels - Easy, Medium, Hard with progressive learning path
- 💻 Dual Language Support - Java & Python templates with identical test cases
- ✅ Built-in Testing - 5-8 test cases per problem including edge cases
- 📊 Progress Tracking - Auto-maintained history to avoid duplicates
- 🎓 Learning Oriented - Hints provided without giving away solutions
- 🚀 Ready to Run - Complete code templates with main entry points
🚀 Quick Start
Basic Usage
User: 出算法题 / 刷题 / 练算法 / algo practice / 来一道题
The skill will:
- Ask for your preferred difficulty level
- Generate a unique problem you haven't seen
- Create ready-to-code templates in both Java and Python
- Track your progress automatically
Example Interaction
User: 刷题
AI: [Asks for difficulty preference]
User: Medium
AI: [Generates problem with templates]
📋 Workflow
Step 1: Check Problem History
Read algo_history.md from the workspace root to track previously assigned problems and ensure no duplicates.
# Algorithm Practice History
| # | Problem Name | Difficulty | Category | Date |
|---|-------------|------------|----------|------|
| 1 | TwoSum | Easy | Array, Hash Table | 2026-03-27 |
Step 2: Ask Difficulty Preference
Use the AskUserQuestion tool:
Question: "Which difficulty level would you like?"
Options:
- 🟢 Easy - Basic data structures & simple logic, perfect for warm-up
- 🟡 Medium - Requires algorithmic thinking, covers common patterns
- 🔴 Hard - Advanced algorithms, optimization, complex data structures
Step 3: Generate Problem
Create an original algorithm problem with:
Problem Structure
- Title: PascalCase format (e.g.,
LongestSubstring,MergeIntervals) - Difficulty Badge: 🟢 Easy / 🟡 Medium / 🔴 Hard
- Description: Clear Chinese explanation of input/output requirements
- Examples: Minimum 2 examples with input/output pairs
- Constraints: Data ranges, time/space complexity requirements
- Hints: Direction hints without revealing the solution
Problem Categories (Rotate through these)
Arrays, Strings, Linked Lists, Trees, Graphs, Dynamic Programming, Greedy, Backtracking, Sorting, Searching, Stack/Queue, Hash Tables, Two Pointers, Sliding Window, Bit Manipulation, BFS/DFS, Divide & Conquer
Step 4: Create Code Templates
Java Template: java/\x3CProblemName>.java
import java.util.*;
public class \x3CProblemName> {
/**
* TODO: Implement your algorithm here
*
* \x3CBrief description of function>
*
* @param \x3Cparameter description>
* @return \x3Creturn value description>
*/
public \x3CReturnType> \x3CmethodName>(\x3CParameters>) {
// Write your code here
return \x3Cdefault value>;
}
public static void main(String[] args) {
\x3CProblemName> solution = new \x3CProblemName>();
int passed = 0;
int total = 0;
// Test Case 1: Normal case
total++;
\x3CType> result1 = solution.\x3CmethodName>(\x3Cinput1>);
if (\x3Ccheck if result1 equals expected1>) {
System.out.println("Test Case " + total + ": ✅ Pass");
passed++;
} else {
System.out.println("Test Case " + total + ": ❌ Fail");
System.out.println(" Input: \x3Cinput description>");
System.out.println(" Expected: \x3Cexpected output>");
System.out.println(" Actual: " + result1);
}
// Test Case 2-N: Include edge cases (minimum 5 total)
// Must cover: normal cases, boundary cases, special cases
System.out.println("\
Results: " + passed + "/" + total + " Passed");
if (passed == total) {
System.out.println("🎉 All tests passed!");
} else {
System.out.println("💪 Keep trying! Review the failed cases above.");
}
}
}
Python Template: python/\x3Cproblem_name>.py
from typing import List, Optional
class Solution:
def \x3Cmethod_name>(self, \x3Cparameters>) -> \x3Creturn_type>:
"""
TODO: Implement your algorithm here
\x3CBrief description of function>
Args:
\x3Cparameter description>
Returns:
\x3Creturn value description>
"""
# Write your code here
pass
def main():
solution = Solution()
passed = 0
total = 0
# Test Case 1: Normal case
total += 1
result1 = solution.\x3Cmethod_name>(\x3Cinput1>)
if result1 == \x3Cexpected1>:
print(f"Test Case {total}: ✅ Pass")
passed += 1
else:
print(f"Test Case {total}: ❌ Fail")
print(f" Input: \x3Cinput description>")
print(f" Expected: \x3Cexpected output>")
print(f" Actual: {result1}")
# Test Case 2-N: Include edge cases (minimum 5 total)
# Must cover: normal cases, boundary cases, special cases
print(f"\
Results: {passed}/{total} Passed")
if passed == total:
print("🎉 All tests passed!")
else:
print("💪 Keep trying! Review the failed cases above.")
if __name__ == "__main__":
main()
Test Case Requirements
- Minimum 5 test cases per problem
- Must include:
- Normal/typical cases
- Edge cases (empty input, single element, maximum values)
- Special cases (negative numbers, duplicates, etc.)
- Consistency: Java and Python test cases must match
- Proper comparison: Use
Arrays.equals()for Java arrays,==for Python lists
Step 5: Update Progress Tracking
Append the problem to algo_history.md in workspace root:
# Algorithm Practice History
| # | Problem Name | Difficulty | Category | Date |
|---|-------------|------------|----------|------|
| 1 | TwoSum | Easy | Array, Hash Table | 2026-03-27 |
| 2 | MergeIntervals | Medium | Array, Sorting | 2026-03-27 |
Auto-increment the sequence number and use current date.
Step 6: Present Problem to User
Display the complete problem with:
- 📝 Problem Title & Difficulty Badge
- 📖 Problem Description (clear Chinese explanation)
- 💡 Examples (input/output pairs)
- ⚙️ Constraints (data ranges, complexity requirements)
- 🎯 Hints (direction without solution)
- 📁 File Locations:
- Java:
java/\x3CProblemName>.java - Python:
python/\x3Cproblem_name>.py
- Java:
- 🚀 Next Steps: "Implement your solution and run the file to test!"
💡 Pro Tips for Users
How to Use Effectively
- Start Easy - Build confidence with fundamentals
- Think First - Try to solve before looking at hints
- Test Thoroughly - Run both Java and Python versions
- Track Progress - Check
algo_history.mdfor your journey - Practice Regularly - Consistency beats intensity
Running Your Solutions
# Java
cd java
javac \x3CProblemName>.java && java \x3CProblemName>
# Python
python python/\x3Cproblem_name>.py
Common Workflow
- Read problem carefully
- Think about approach (don't code immediately!)
- Write solution in the TODO section
- Run tests to verify
- Debug failed cases
- Optimize if needed
- Move to next problem
🎯 Problem Quality Standards
- ✅ Interview-Relevant: Based on real coding interview questions
- ✅ Well-Tested: 5-8 comprehensive test cases
- ✅ Progressive Difficulty: Clear learning path
- ✅ No Duplicates: Tracked via history file
- ✅ Bilingual: Java + Python with consistent logic
- ✅ Production-Ready: Ready to compile and run
🛠️ Technical Requirements
- Method signatures must be clear and type-safe
- Java filename MUST match public class name
- Python filename uses snake_case convention
- Problem titles use PascalCase (e.g.,
ValidParentheses) - NEVER include solutions or implementation hints in code files
- Test case expected outputs MUST be correct
- Create
java/andpython/directories if they don't exist
🌟 Target Audience
- 👨💻 Job seekers preparing for coding interviews
- 🎓 Computer science students learning algorithms
- 🔄 Developers wanting to practice problem-solving
- 🌱 Beginners starting their algorithm journey
- 🏆 Advanced programmers tackling hard problems
📊 Success Metrics
After using this skill, users should:
- Have working code templates ready to implement
- Understand the problem clearly with examples
- Know the constraints and edge cases
- Feel motivated to solve and test their solution
- Track their progress over time
💡 Tip: This skill is perfect for daily algorithm practice. Try solving 1-2 problems per day to build strong problem-solving skills!
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install algorithm-practice - 安装完成后,直接呼叫该 Skill 的名称或使用
/algorithm-practice触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Train your mind with algorithms 是什么?
🎯 Interactive algorithm practice with 100+ problems across Easy/Medium/Hard difficulties. Generates ready-to-run code templates in Java & Python with built-... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 73 次。
如何安装 Train your mind with algorithms?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install algorithm-practice」即可一键安装,无需额外配置。
Train your mind with algorithms 是免费的吗?
是的,Train your mind with algorithms 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Train your mind with algorithms 支持哪些平台?
Train your mind with algorithms 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Train your mind with algorithms?
由 KadiJIN(@kadijin)开发并维护,当前版本 v1.0.0。