Skip to content

Instantly share code, notes, and snippets.

@stefanroeck
stefanroeck / findNumbers.test.ts
Created January 19, 2023 20:31
Find all numbers a and b with distinct digits where a-b=42137
describe("numbertest", () => {
const digitsOf = (n: number): number[] => {
const digits = [];
const s = n.toString();
for (let i = 0; i < s.length; i++) {
const digit = parseInt(s.charAt(i));
digits.push(digit);
}
return digits;
@stefanroeck
stefanroeck / FreezeRuleConfiguration.java
Last active January 1, 2024 22:18
XmlFileBasedViolationStore: Store ArchUnit violations in an XML-based VCS-friendly format
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.immutables.value.Value;
@Value.Immutable
public interface FreezeRuleConfiguration {
@FunctionalInterface
public interface RuleStore {