package lc.mecha.util;

import lc.mecha.log.MechaLogger;
import lc.mecha.log.MechaLoggerFactory;

public class NumberSetUtil {
    private static final MechaLogger logger = MechaLoggerFactory.getLogger(NumberSetUtil.class);

    public static int getNext(int idx, int sz) {
        return (idx + 1) % sz;
    }

    public static int getPrev(int idx, int sz) {
        int i = (idx - 1) % sz;

        return i < 0 ? i + sz : i;
    }
}
