Data validator

https://www.npmjs.com/package/validatorjs

3069. Distribute Elements Into Two Arrays I

You are given a 1-indexed array of distinct integers nums of length n. You need to distribute all the elements of nums between two arrays arr1 and arr2 using n operations. In the first operation, append nums[1] to arr1. In the second operation, append nums[2] to arr2. Afterwards, in the ith operation: If the last element of arr1 is greater than the last element of arr2, append nums[i] to arr1. Otherwise, append nums[i] to arr2. The array result is formed by concatenating the arrays arr1 and arr2. For example, if arr1 == [1,2,3] and arr2 == [4,5,6], then result = [1,2,3,4,5,6]. Return the array result.
/**
 * @param {number[]} nums
 * @return {number[]}
 */
var resultArray = function(nums) {

    // arr1 starts with the first element
    const arr1 = [nums[0]];

    // arr2 starts with the second element
    const arr2 = [nums[1]];

    // Process the rest of the array starting from index 2
    for (let i = 2; i < nums.length; i++) {

        // Compare the last elements of arr1 and arr2
        // If arr1's last element is greater, append to arr1
        if (arr1[arr1.length - 1] > arr2[arr2.

DOTNET Cli Markdown

DOTNET Cli Markdown
Here is a comprehensive .NET CLI cheat sheet formatted cleanly in Markdown. 
If you are just getting started, you might want to learn how to install the .NET SDK first, or explore how to use .NET CLI in CI/CD pipelines to automate your builds. 
.NET CLI Cheat Sheet 
ℹ️ Environment & Diagnostics 

| Command | Description  |
| --- | --- |
| — | Display the active .NET SDK version.  |
| — | Display detailed environment information (OS, architecture, runtimes).  |
| — | List all installed .NET SDK v

1386. Cinema Seat Allocation

A cinema has n rows of seats, numbered from 1 to n. Each row has 10 seats, numbered from 1 to 10. You are given a 2D integer array reservedSeats, where reservedSeats[i] = [rowi, seati] means that seat seati in row rowi is already reserved. A four-person group must be assigned to four seats in the same row. The group can be seated in one of the following seat blocks: seats 2, 3, 4, 5 seats 4, 5, 6, 7 seats 6, 7, 8, 9 A block can be used only if none of its seats are reserved. Each seat can be assigned to at most one group. Return an integer denoting the maximum number of four-person groups that can be assigned.
/**
 * @param {number} n
 * @param {number[][]} reservedSeats
 * @return {number}
 */
var maxNumberOfFamilies = function(n, reservedSeats) {
    const map = new Map();

    // Build row → reserved seats set
    for (const [r, s] of reservedSeats) {
        if (!map.has(r)) map.set(r, new Set());
        map.get(r).add(s);
    }

    let result = 0;

    // Blocks
    const A = [2,3,4,5];
    const B = [4,5,6,7];
    const C = [6,7,8,9];

    function free(block, reserved) {
        return block.

Global CLAUDE file

# Fable usage policy

Fable is for orchestration, design, and decisions ONLY. Never spend Fable tokens on chores, implementation, file reading/summarizing, documentation writing, or verification passes. Two sanctioned patterns:

1. **Fable as orchestrator**: Fable plans and delegates all actual work to worker subagents (`model: "opus"` or `model: "sonnet"` via the Agent tool). Workers read, implement, write docs, and verify; Fable judges their reports and decides.
2. **Fable as advisor**: a Sonn

Download Snippets from Cacher.io using API

import requests
import os
from pathlib import Path

from dotenv import load_dotenv

load_dotenv()

# ============================================================
# CONFIGURATION
# ============================================================

# Put the GUID from the Cacher snippet URL here
SNIPPET_GUID = "guid:e85aaf8e119674c40f13"
OUTPUT_FOLDER = Path("cacher_download")

CACHER_API_KEY = os.environ.get("CACHER_API_KEY")
CACHER_API_TOKEN = os.environ.get("CACHER_API_TOKEN")

# 

3471. Find the Largest Almost Missing Integer

You are given an integer array nums and an integer k. An integer x is almost missing from nums if x appears in exactly one subarray of size k within nums. Return the largest almost missing integer from nums. If no such integer exists, return -1. A subarray is a contiguous sequence of elements within an array.
/**
 * @param {number[]} nums
 * @param {number} k
 * @return {number}
 */
var largestInteger = function(nums, k) {
    const n = nums.length;

    // Case 1: k = 1;
    if (k === 1) {
        const freq = new Map();
        for (let x of nums) freq.set(x, (freq.get(x) || 0) + 1);

        let ans = -1;
        for (let [x, f] of freq) {
            if (f === 1) ans = Math.max(ans, x);
        }
        return ans;
    }

    // Case 2: k = n
    if (k === n) {
        return Math.max(...nums);

Tailwind no-js variant

https://markpinero.com/blog/no-js-variants

1563. Stone Game V

There are several stones arranged in a row, and each stone has an associated value which is an integer given in the array stoneValue. In each round of the game, Alice divides the row into two non-empty rows (i.e. left row and right row), then Bob calculates the value of each row which is the sum of the values of all the stones in this row. Bob throws away the row which has the maximum value, and Alice's score increases by the value of the remaining row. If the value of the two rows are equal, Bob lets Alice decide which row will be thrown away. The next round starts with the remaining row. The game ends when there is only one stone remaining. Alice's score is initially zero. Return the maximum score that Alice can obtain.
/**
 * @param {number[]} stoneValue
 * @return {number}
 */
var stoneGameV = function(stoneValue) {
    const n = stoneValue.length;
    const prefix = new Array(n + 1).fill(0);
    for (let i = 0; i < n; i++) prefix[i + 1] = prefix[i] + stoneValue[i];

    const sum = (l, r) => prefix[r + 1] - prefix[l];

    const dp = Array.from({ length: n }, () => Array(n).fill(0));

    // length = size of interval
    for (let len = 2; len <= n; len++) {
        for (let l = 0; l + len - 1 < n; l++) {
   

サーバー側とResendのDNSを連携させる手順例(Xserver)

# Resend送信ドメイン設定(Xserver)

## 手順

### 1. Resendにドメインを追加

- ドメイン:`dentalhr.jp`
- リージョン:東京(`ap-northeast-1`)
- 理由:ドメイン用のDKIM鍵と検証対象のDNSレコードをResendに発行させるため

### 2. XserverにDNSレコードを追加

Resendに表示された値をXserverの`dentalhr.jp`用DNSレコード設定へ登録。

#### DKIM

- 種別:`TXT`
- ホスト名:`resend._domainkey`
- 値:Resendが発行したDKIM公開鍵
- 理由:受信側がメールのDKIM署名を検証するため

#### Return-Path

- 種別:`MX`
- ホスト名:`send`
- 値:`feedback-smtp.ap-northeast-1.amazonses.com`
- 優先度:`10`
- 理由:バウンスなどの配送結果をAmazon SES側で処理するため

#### SPF

- 種別:`TXT`
- ホスト名:`s

2029. Stone Game IX

Alice and Bob continue their games with stones. There is a row of n stones, and each stone has an associated value. You are given an integer array stones, where stones[i] is the value of the ith stone. Alice and Bob take turns, with Alice starting first. On each turn, the player may remove any stone from stones. The player who removes a stone loses if the sum of the values of all removed stones is divisible by 3. Bob will win automatically if there are no remaining stones (even if it is Alice's turn). Assuming both players play optimally, return true if Alice wins and false if Bob wins.
/**
 * @param {number[]} stones
 * @return {boolean}
 */
var stoneGameIX = function(stones) {
    // cnt[0], cnt[1], cnt[2] = counts of stones with value % 3 == 0, 1, 2
    const base = [0, 0, 0];
    for (let x of stones) {
        base[x % 3]++;
    }

    // Check function: assumes we try to start with remainder 1
    function check(cnt) {
        // If we have no remainder-1 stones, this start is impossible
        if (cnt[1] === 0) return false;

        // Use one remainder-1 stone as Alic

3702. Longest Subsequence With Non-Zero Bitwise XOR

You are given an integer array nums. Return the length of the longest subsequence in nums whose bitwise XOR is non-zero. If no such subsequence exists, return 0.
/**
 * @param {number[]} nums
 * @return {number}
 */
var longestSubsequence = function(nums) {
    let xor = 0;
    for (let x of nums) xor ^= x;

    if (xor !== 0) return nums.length;

    // xor == 0
    for (let x of nums) {
        if (x !== 0) return nums.length - 1;
    }

    return 0; // all zeros
};

3090. Maximum Length Substring With Two Occurrences

Given a string s, return the maximum length of a substring such that it contains at most two occurrences of each character.
/**
 * @param {string} s
 * @return {number}
 */
var maximumLengthSubstring = function(s) {
    let freq = new Map();
    let left = 0;
    let maxLen = 0;

    for (let right = 0; right < s.length; right++) {
        const char = s[right];
        freq.set(char, (freq.get(char) || 0) + 1);

        // shrink window while any char appears more than twice
        while (freq.get(char) > 2) {
            const leftChar = s[left];
            freq.set(leftChar, freq.get(leftChar) - 1);
            

Claude doc files

# Project Structure

A reference tree of the repository. Generated from the working tree; regenerate when the
layout changes materially.

## Excluded from this tree

`.git/`, `.venv/`, `__pycache__/`, `.pytest_cache/`, `node_modules/`, media uploads
(`uploads/`), and log files. `.idea/` (JetBrains IDE config, tracked in git) is collapsed
to a single line.

Included by request even though they are build output / local-only: the collected
`staticfiles/` tree and the `db.sqlite3` databa

CLAUDE.md , AGENTS.md

refer to AGENTS.md

Claude Rules files

# Planning Rules

Owner: Gal Sarig ~ Last updated: 15/08/2026

## Purpose

- Define how plans are created, reviewed, and executed in this repository.

## Plan Location and Lifecycle

- Treat `.claude/plans/` at the repository root as the source of truth for plans.
- For any plan-related request, fir3st read existing `.claude/plans/*.md` plans, even when no specific plan file is
  referenced.
- Save every new or updated implementation plan as a Markdown file in `.claude/plans/`.
- I