
export function getChapterAndDifficulty(value: string): { id: number; diff: number } | null {
  const regex = /(\d+)_(-?\d+)/;
  const matches = value.match(regex);

  if (matches && matches.length === 3) {
    const id = parseInt(matches[1]);
    const diff = parseInt(matches[2]);
    return { id, diff };
  }
  return null;
}
