2573. Find the String with LCP

We define the lcp matrix of any 0-indexed string word of n lowercase English letters as an n x n grid such that: lcp[i][j] is equal to the length of the longest common prefix between the substrings word[i,n-1] and word[j,n-1]. Given an n x n matrix lcp, return the alphabetically smallest string word that corresponds to lcp. If there is no such string, return an empty string. A string a is lexicographically smaller than a string b (of the same length) if in the first position where a and b differ, string a has a letter that appears earlier in the alphabet than the corresponding letter in b. For example, "aabd" is lexicographically smaller than "aaca" because the first position they differ is at the third letter, and 'b' comes before 'c'.
/**
 * @param {number[][]} lcp
 * @return {string}
 */
var findTheString = function(lcp) {
    const n = lcp.length;

    // -----------------------------
    // 1. Validate the diagonal
    // -----------------------------
    // lcp[i][i] must equal the length of the suffix starting at i.
    for (let i = 0; i < n; i++) {
        if (lcp[i][i] !== n - i) {
            return ""; // impossible
        }
    }

    // -----------------------------
    // 2. Union-Find to group equal positions
  

AWS DDoS コスト爆発防止策

# AWS DDoS コスト爆発防止策まとめ

**出典:** [DDoS攻撃でAWS請求が200万円に!S3・CloudFrontで絶対やるべきコスト爆発防止策 6選 - Qiita](https://qiita.com/miruky/items/b996e374c91923141178)

---

## 事例

2026年3月、個人開発者のS3バケットがDDoS攻撃を受け、3日間で160TBのデータ転送が発生し約$15,000(約200万円)の請求が発生。

## なぜ高額になるか

S3はデフォルトでレート制限がなく、パブリックバケットへは事実上無制限にGETリクエストを送れる。160TB転送時のデータ転送料金は約$14,140(東京リージョン)。

| データ転送量 | 単価 |
|---|---|
| 〜10TB | $0.114/GB |
| 10TB〜50TB | $0.089/GB |
| 50TB〜150TB | $0.086/GB |
| 150TB超 | $0.084/GB |

---

## 防止策(優先度順)

| 優先度 | 対策 | コスト |
|--

cssでデータ属性の値をcalcやCSSプロパティの値に使用する

<p class="badge" data-size="1.6" data-color="orange">文字</p>

多言語対応実施時のhead追記事項(SEO)

<head>
  <!-- 日本語版ページの場合 -->
  <link rel="alternate" hreflang="ja" href="https://example.com/ja/page" />
  <link rel="alternate" hreflang="en" href="https://example.com/en/page" />
  <link rel="alternate" hreflang="zh" href="https://example.com/zh/page" />
  <!-- フォールバック(言語が一致しない場合のデフォルト) -->
  <link rel="alternate" hreflang="x-default" href="https://example.com/" />
</head>

無限スクロールなどでcanvasを大量に描画する場合のメモリ管理

<div class="grid" id="grid"></div>

Sticky header and how to solve the indentation?

/* 1 */
html {
  scroll-behavior: smooth;
  /* Set this to the height of your header */
  scroll-padding-top: 80px; 
}


/* 2 */
.anchor-section::before {
  content: "";
  display: block;
  /* Negative margin pulls the element back up */
  margin-top: -100px; 
  /* Height creates the "blocker" space */
  height: 100px; 
  visibility: hidden;
  pointer-events: none;
}

/* 3 */
section:target {
  border-top: 80px solid transparent;
  margin-top: -80px;
  background-clip: padding-box;
}

Prefetch/Preload/Preconnect

<!--
https://medium.com/@TusharKanjariya/four-lines-in-head-changed-my-site-speed-449bfeb396a2
-->


<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>My App</title>

  <!-- Step 1: Warm up third-party connections first -->
  <link rel="preconnect" href="https://fonts.googleapis.com">
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  <link rel="dns-prefetch" href="https://analytics.myapp.com">

Bundle update

serve para atualizar uma gem específica de forma mais segura, evitando mudanças desnecessárias nas dependências.
bundle update <gem_name> --conservative

prds

Blitzy
P
Paul
Free
Paul weezy Design
New product • Tech spec ready

Select destination

1
Build prompt
2
Agent action plan
3
Code
4
Project guide
Contents
Agent Action Plan
1. Introduction
1.1 Executive Summary
1.1.1 Project Overview
AutoDev Army represents a revolutionary approach to software development automation, delivering an autonomous multi-agent pipeline designed to build, test, and deploy web applications with minimal human intervention. The system leverages OpenAI

Disable Gutenberg

add_filter('use_block_editor_for_post', '__return_false');
add_filter('use_block_editor_for_post_type', '__return_false');

2946. Matrix Similarity After Cyclic Shifts

You are given an m x n integer matrix mat and an integer k. The matrix rows are 0-indexed. The following proccess happens k times: Even-indexed rows (0, 2, 4, ...) are cyclically shifted to the left. Odd-indexed rows (1, 3, 5, ...) are cyclically shifted to the right. Return true if the final modified matrix after k steps is identical to the original matrix, and false otherwise.
/**
 * @param {number[][]} mat
 * @param {number} k
 * @return {boolean}
 */
var areSimilar = function(mat, k) {
  for (let row of mat) {
    const n = row.length;
    const shift = k % n;

    // Left shift for even rows, right shift for odd rows
    // But instead of simulating, just check if shifting preserves equality

    // Build shifted versions
    const left = row.slice(shift).concat(row.slice(0, shift));
    const right = row.slice(n - shift).concat(row.slice(0, n - shift));

    // If

Prepare local environment

# GCP Local Environment

## Prepare Local Environment

Follow the official documentation available at https://docs.cloud.google.com/docs/authentication/set-up-adc-local-dev-environment

CLI Installation: https://docs.cloud.google.com/sdk/docs/install-sdk

### Re-authorize credentials
`gcloud auth application-default login`

faq schema

<script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "FAQPage",
      "mainEntity": [
        {%- for block in section.blocks -%}
          {
            "@type": "Question",
            "name": {{ block.settings.title | json }},
            "acceptedAnswer": {
              "@type": "Answer",
              "text": {{ block.settings.text | json }}
            }
          }{% unless forloop.last %},{% endunless %}
        {%- endfor -%}
      ]
    }
  

Git Aliases Setup

# Git Aliases Setup Notes

**Machine:** Lenovo ThinkPad T14 Gen 2
**OS:** Ubuntu 24.04 LTS (Dual Boot)
**Date:** March 25, 2026

---

## Overview

Global git aliases configured for faster branch switching. All aliases are stored in `~/.gitconfig` and apply across every repository on the machine.

---

## Configure Aliases

```bash
git config --global alias.co checkout
git config --global alias.cm "checkout master"
git config --global alias.cq "checkout qa"
git config --global alias.cp "checkout 

Git Worktrees Setup

# Git Worktrees Setup Notes

**Machine:** Lenovo ThinkPad T14 Gen 2
**OS:** Ubuntu 24.04 LTS (Dual Boot)
**Date:** March 25, 2026

---

## Overview

Git Worktrees allow multiple branches of the same repository to be checked out simultaneously, each in its own folder, all sharing a single `.git` database. This eliminates the need to stash or resolve conflicts just to switch context — each worktree is fully independent on disk.

The alternative — cloning the same repo into multiple folders — achie

Git Pull, Merge, and Rebase Guide

# Git Pull, Merge, and Rebase Guide

A practical reference for understanding how git integrates changes between branches, when to use each strategy, and how to avoid common pitfalls.

## The Fundamentals

Git has two core ways to integrate changes from one branch into another: **merge** and **rebase**. `git pull` is a shorthand that combines `git fetch` + one of these two.

---

## 1. Merge

```
Before:
master:    A → B → C → D
                \
feature:         E → F → G

After `git merge maste