2265. Count Nodes Equal to Average of Subtree

Given the root of a binary tree, return the number of nodes where the value of the node is equal to the average of the values in its subtree. Note: The average of n elements is the sum of the n elements divided by n and rounded down to the nearest integer. A subtree of root is a tree consisting of root and all of its descendants.
/**
 * Definition for a binary tree node.
 * function TreeNode(val, left, right) {
 *     this.val = (val===undefined ? 0 : val)
 *     this.left = (left===undefined ? null : left)
 *     this.right = (right===undefined ? null : right)
 * }
 */
/**
 * @param {TreeNode} root
 * @return {number}
 */
var averageOfSubtree = function(root) {
    let ans = 0;

    function dfs(node) {
        if (!node) return [0, 0]; // sum, count

        const [ls, lc] = dfs(node.left);
        const [rs, rc] = dfs

Show-Me

可以。以下我建議你採用 **Windows + Codex App / Codex CLI 的全域安裝 SOP**。目標是讓所有專案都能使用 `$show-me`,並把 HumanLayer 裡偏 Claude Code/macOS 的部分改成 Codex-friendly。

Codex 官方目前會從 `$HOME/.agents/skills` 載入使用者層級 Skill;專案層則是 `<repo>/.agents/skills`。Skill 核心只需要目錄裡有 `SKILL.md`,且 frontmatter 至少包含 `name` 與 `description`。([OpenAI Developers][1])

# SOP:安裝 `humanlayer/show-me`

## 1. 先確認 Node.js

PowerShell:

```powershell
node -v
npx -v
```

目前 `skills` CLI 的套件要求 Node.js `>= 22.20.0`。([GitHub][2])

如果你的 Node 已符合

更新 Skills

可以,但要先把「版本」分成兩件事。你現在看到的 **`1.2.3` 是 `mattpocock/skills` 整個 repository / package 的版本**;目前 `package.json` 的確是 `1.2.3`。但 `grill-me`、`grill-with-docs` 個別的 `SKILL.md` **沒有自己的 semver `version:` 欄位**。([GitHub][1])

你之前是在 Codex 用 `npx skills ... --global` 這條路安裝,所以我建議以下都以 **Global Skill** 為主。

### 1. 先看 Codex 現在實際裝了哪些 Skills

在 PowerShell 執行:

```powershell
npx skills@latest list -g -a codex
```

應該會看到類似:

```text
Global Skills

grill-me
grill-with-docs
...
```

Codex 的 global skill

General_Listening_set_1_test_1

simpson
13
7RT
7:30
F23
B
C
E
G
K
J
F
B
E
C
fruits
second floor
one
terrase
at the restaurant
50%

global warming
hotspots
overnight
consequences
foreign students
2 hours
exam
course tutors
fat layer
killer wales
C
A
B
rising temparature
two degrees
nesting areas
breeding ice platform
food

Using HwRegChkVars to bypass requirements for Windows 11 Upgrades

# Using HwRegChkVars to bypass requirements for Windows 11 Upgrades

## Process

1. Open Registry Editor to this key `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags`
2. Create a new _Key_ called `HwReqChk`
3. Verify/Change registry key to `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\HwReqChk`
4. Create a new **Multi-String Value** called `HwReqChkVars`
5. Enter the following values:<br>
```plaintext
SQ_SecureBootCapable=TRUE
SQ_S

FLIP Sheeter

Add in a detail wrangle to add additional particles in thin areas of a flip sim (post-sim) to fill in gaps and fix flickering meshes
// Use in detail wrangle

float search_radius = chf("search_radius");
float min_dist = chf("min_dist");
int points_per_pt = chi("points_per_pt");
int max_neighbors = chi("max_neighbors");
int seed = chi("seed");

int original_npts = npoints(0);

for (int pt = 0; pt < original_npts; pt++)
{
    vector P0 = point(0, "P", pt);
    int near[] = nearpoints(0, P0, search_radius, max_neighbors);

    // Need enough particles to define local volume
    if (len(near) < 4)
        continue;

    for (int 

3871. Count Commas in Range II

You are given an integer n. Return the total number of commas used when writing all integers from [1, n] (inclusive) in standard number formatting. In standard formatting: A comma is inserted after every three digits from the right. Numbers with fewer than 4 digits contain no commas.
/**
 * @param {number} n
 * @return {number}
 */
var countCommas = function(n) {
    // Convert n to BigInt so all math stays consistent
    n = BigInt(n);

    // Use BigInt for total since we accumulate BigInt values
    let total = 0n;

    // k represents how many commas numbers in this group have
    // Group 1 → 1 comma (digits 4–6)
    // Group 2 → 2 commas (digits 7–9)
    // Group 3 → 3 commas (digits 10–12)
    // ... up to n ≤ 10^15 → at most 4 commas
    for (let k = 1n; k <= 5n; k++

3870. Count Commas in Range

You are given an integer n. Return the total number of commas used when writing all integers from [1, n] (inclusive) in standard number formatting. In standard formatting: A comma is inserted after every three digits from the right. Numbers with fewer than 4 digits contain no commas.
/**
 * @param {number} n
 * @return {number}
 */
var countCommas = function(n) {
    // Numbers from 1 to 999 never contain commas in standard formatting.
    // Starting at 1000, every number has exactly ONE comma (e.g., "1,000", "4,582").

    // So we simply count how many numbers from 1000 up to n exist.
    // If n < 1000, the result should be 0 - hence Math.max(0, n - 999).

    return Math.max(0, n - 999);
};

940. Distinct Subsequences II

Given a string s, return the number of distinct non-empty subsequences of s. Since the answer may be very large, return it modulo 109 + 7. A subsequence of a string is a new string that is formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. (i.e., "ace" is a subsequence of "abcde" while "aec" is not.
/**
 * @param {string} s
 * @return {number}
 */
var distinctSubseqII = function(s) {
    const MOD = 1_000_000_007;
    const last = Array(26).fill(0);

    let dp = 1; // counts empty subsequence initially

    for (const ch of s) {
        const idx = ch.charCodeAt(0) - 97;

        const newDp = (dp * 2 % MOD - last[idx] + MOD) % MOD;

        last[idx] = dp;
        dp = newDp;
    }

    return (dp - 1 + MOD) % MOD; // remove empty subsequence
};

Mermaid

# Mermaid

### Generate PNG images
`npx @mermaid-js/mermaid-cli --scale 2.5 -i mermaid-diagram.md -o diagram.png`

115. Distinct Subsequences

Given two strings s and t, return the number of distinct subsequences of s which equals t. The test cases are generated so that the answer fits on a 32-bit signed integer.
/**
 * @param {string} s
 * @param {string} t
 * @return {number}
 */
var numDistinct = function(s, t) {
    const m = s.length, n = t.length;

    // dp[j] = number of ways to form t[0..j-1] using processed part of s
    const dp = Array(n + 1).fill(0);

    // Empty string t ("") can always be formed once — by deleting everything
    dp[0] = 1;

    // Iterate through characters of s
    for (let i = 1; i <= m; i++) {

        // Traverse backwards so dp[j - 1] refers to previous row's value
 

3904. Smallest Stable Index II

You are given an integer array nums of length n and an integer k. For each index i, define its instability score as max(nums[0..i]) - min(nums[i..n - 1]). In other words: max(nums[0..i]) is the largest value among the elements from index 0 to index i. min(nums[i..n - 1]) is the smallest value among the elements from index i to index n - 1. An index i is called stable if its instability score is less than or equal to k. Return the smallest stable index. If no such index exists, return -1.
/**
 * @param {number[]} nums
 * @param {number} k
 * @return {number}
 */
var firstStableIndex = function(nums, k) {
    const n = nums.length;

    // Build suffix min
    const suffMin = Array(n);
    suffMin[n - 1] = nums[n - 1];
    for (let i = n - 2; i >= 0; i--) {
        suffMin[i] = Math.min(suffMin[i + 1], nums[i]);
    }

    let prefMax = -Infinity;

    for (let i = 0; i < n; i++) {
        prefMax = Math.max(prefMax, nums[i]);
        if (prefMax - suffMin[i] <= k) return i;
    }

3903. Smallest Stable Index I

You are given an integer array nums of length n and an integer k. For each index i, define its instability score as max(nums[0..i]) - min(nums[i..n - 1]). In other words: max(nums[0..i]) is the largest value among the elements from index 0 to index i. min(nums[i..n - 1]) is the smallest value among the elements from index i to index n - 1. An index i is called stable if its instability score is less than or equal to k. Return the smallest stable index. If no such index exists, return -1.
/**
 * @param {number[]} nums
 * @param {number} k
 * @return {number}
 */
var firstStableIndex = function(nums, k) {
    const n = nums.length;

    // Build prefix max
    const prefixMax = Array(n);
    prefixMax[0] = nums[0];
    for (let i = 1; i < n; i++) {
        prefixMax[i] = Math.max(prefixMax[i - 1], nums[i]);
    }

    // Build suffix min
    const suffixMin = Array(n);
    suffixMin[n - 1] = nums[n - 1];
    for (let i = n - 2; i >= 0; i--) {
        suffixMin[i] = Math.min(suffix

Pre render pages with blocks / templates

<?php
// Advantage of this approach is you can design visually in the editor first

function dlrg_filter_post_content( $content, $post ) {
	

	if ( $post->post_type === 'event' ):
	
	// -----
	$content ='';
	//------ 
	
	endif;
		
	return $content;
}
add_filter( 'default_content', 'dlrg_filter_post_content', 10, 2 );

3876. Construct Uniform Parity Array II

You are given an array nums1 of n distinct integers. You want to construct another array nums2 of length n such that the elements in nums2 are either all odd or all even. For each index i, you must choose exactly one of the following (in any order): nums2[i] = nums1[i] nums2[i] = nums1[i] - nums1[j], for an index j != i, such that nums1[i] - nums1[j] >= 1 Return true if it is possible to construct such an array, otherwise return false.
/**
 * @param {number[]} nums1
 * @return {boolean}
 */
var uniformArray = function(nums1) {
    nums1.sort((a, b) => a - b);

    let smallestOdd = null;
    let smallestEven = null;

    for (let x of nums1) {
        if (x % 2 === 1 && smallestOdd === null) smallestOdd = x;
        if (x % 2 === 0 && smallestEven === null) smallestEven = x;
    }

    // Check possibility of all-even
    let allEvenPossible = true;
    for (let x of nums1) {
        if (x % 2 === 1) {
            // odd needs