Update .gitignore for IntelliJ.
Solve semigroup.
Simplify success check line in testAlgorithm.