1189. Maximum Number of Balloons

Given a string text, you want to use the characters of text to form as many instances of the word "balloon" as possible. You can use each character in text at most once. Return the maximum number of instances that can be formed.
/**
 * @param {string} text
 * @return {number}
 */
var maxNumberOfBalloons = function(text) {
    const freq = { b:0, a:0, l:0, o:0, n:0};

    for (const ch of text) {
        if (freq.hasOwnProperty(ch)) freq[ch]++;
    }

    // l and o are needed twice
    freq.l = Math.floor(freq.l / 2);
    freq.o = Math.floor(freq.o / 2);

    return Math.min(freq.b, freq.a, freq.l, freq.o, freq.n);
};

PROD NESTED

{
  "collapsible": false,
  "key": "panel",
  "type": "panel",
  "label": "Panel",
  "input": false,
  "tableView": false,
  "components": [
    {
      "label": "Columns",
      "columns": [
        {
          "components": [
            {
              "label": "Init helpers",
              "key": "_init_helpers",
              "type": "hidden",
              "input": true,
              "persistent": false,
              "calculateValue": "if (!window._catastoHelpers) {\n  window._catastoHel

1833. Maximum Ice Cream Bars

It is a sweltering summer day, and a boy wants to buy some ice cream bars. At the store, there are n ice cream bars. You are given an array costs of length n, where costs[i] is the price of the ith ice cream bar in coins. The boy initially has coins coins to spend, and he wants to buy as many ice cream bars as possible. Note: The boy can buy the ice cream bars in any order. Return the maximum number of ice cream bars the boy can buy with coins coins. You must solve the problem by counting sort.
/**
 * @param {number[]} costs
 * @param {number} coins
 * @return {number}
 */
var maxIceCream = function(costs, coins) {
    // Find the maximum cost so we know how large our frequency array must be.
    // This avoids sorting and lets us count how many bars exist at each price.
    const maxCost = Math.max(...costs);

    // Frequency array where freq[p] = number of bars that cost 'p' coins.
    const freq = new Array(maxCost + 1).fill(0);

    // Count how many bars exist at each price.
    

Gemini-SysInit-WebApp

Google Developer Web Application
System Initialization Prompt: Project DistroTrench (Supervisor Instance)

You are the Senior Project Supervisor, Lead Architect, and Chromium-Based Technology Tutor. You are collaborating with an experienced Google Developer to build "DistroTrench"—a high-performance Linux distribution search, comparison, and analysis web application.

1. Core Tech Stack & Architecture
- Frontend Web Technologies: A hybrid, high-performance web UI leveraging both JavaScript (for lightweight, dynamic DOM operatio

1840. Maximum Building Height

You want to build n new buildings in a city. The new buildings will be built in a line and are labeled from 1 to n. However, there are city restrictions on the heights of the new buildings: The height of each building must be a non-negative integer. The height of the first building must be 0. The height difference between any two adjacent buildings cannot exceed 1. Additionally, there are city restrictions on the maximum height of specific buildings. These restrictions are given as a 2D integer array restrictions where restrictions[i] = [idi, maxHeighti] indicates that building idi must have a height less than or equal to maxHeighti. It is guaranteed that each building will appear at most once in restrictions, and building 1 will not be in restrictions. Return the maximum possible height of the tallest building.
/**
 * @param {number} n
 * @param {number[][]} restrictions
 * @return {number}
 */
var maxBuilding = function(n, restrictions) {
    // Step 1: add building 1
    restrictions.push([1, 0]);
    
    // Step 2: sort
    restrictions.sort((a, b) => a[0] - b[0]);

    // Step 3: left-to-right tighten
    for (let i = 1; i < restrictions.length; i++) {
        const [idPrev, hPrev] = restrictions[i - 1];
        const [id, h] = restrictions[i];
        restrictions[i][1] = Math.min(h, hPrev + (id 

1732. Find the Highest Altitude

There is a biker going on a road trip. The road trip consists of n + 1 points at different altitudes. The biker starts his trip on point 0 with altitude equal 0. You are given an integer array gain of length n where gain[i] is the net gain in altitude between points i and i + 1 for all (0 <= i < n). Return the highest altitude of a point.
/**
 * @param {number[]} gain
 * @return {number}
 */
var largestAltitude = function(gain) {
    // Current altitude as we move through the gain array.
    // We always start at altitude 0.
    let altitude = 0;

    // Track the highest altitude reached at any point.
    // Since we start at 0, the minimum possible highest altitude is 0.
    let highest = 0;

    // Iterate through each change in altitude.
    for (let g of gain) {
        // Apply the gain/loss to the current altitude.
       

FLIP Dual Rest Noise

Advects noise through a flip simulation using the dual rest fields that are advected through the sim when enabled in the flip solver. MUST promote rest_ratio and rest2_ratio attributes from detail to points.
float freq = chf("freq");

float n_rest = noise(v@rest  * freq);
float n_rest_2 = noise(v@rest2 * freq);

float nr = f@rest_ratio;
float nr2 = f@rest2_ratio;

float n = (n_rest * nr + n_rest_2 * nr2) / max(nr + nr2, 0.0001);

f@noise = n;

shareAPIでコピーも共有も実現する

<button class="share-button" type="button" data-open-share>共有する</button>

IELTS 5-13

Gloria
Forthy
451
bank transfer
cats
8:30
clothes
nurse
information bag
weekend
60
married couple

independatble
website
guest

one-day
control
special tools
B
A
C
A
C
well head
carb rock
sensors
by sattelite
4 weeks
cociousness
subcontious


sense organs
concerns
homework
C
E
G


disinclined
altitude

ash card

4136270125297745   06/31  954

1344. Angle Between Hands of a Clock

Given two numbers, hour and minutes, return the smaller angle (in degrees) formed between the hour and the minute hand. Answers within 10-5 of the actual value will be accepted as correct.
/**
 * @param {number} hour
 * @param {number} minutes
 * @return {number}
 */
var angleClock = function(hour, minutes) {
    // Normalize hour 12 → 0
    if (hour === 12) hour = 0;

    const minuteAngle = minutes * 6;    // 6° per minute
    const hourAngle = hour * 30 + minutes * 0.5;    // 30° per hour + 0.5° per minute

    let diff = Math.abs(hourAngle - minuteAngle);
    return Math.min(diff, 360 - diff);
};

Zed Git Push and Commit Task + Keymap

Register an action to do both things in zed text editor
[
  {
      "label": "Git Commit & Push",
      "command": "git add . && git commit -m \"💻🐧 Updates\" && git push",
      "reveal": "never",
   },
 ]

单纯复制

function Command(v) {
    let oInput = document.createElement('textarea');
    oInput.innerHTML = v;
    document.body.appendChild(oInput);
    oInput.select();
    document.execCommand("Copy");
    oInput.style.display = 'none'
    document.body.removeChild(oInput);
}

이미지번역,ocr

김운 6/18 14:07:57
https://imagetranslate.ai/

ID: hero21js@11stcorp.com
비밀번호: Jane180425~~

이게 상세번역하는겜다

김운 6/18 14:08:40
[图片] 여기서 아무거나 선택하무 됨다 

3614. Process String with Special Operations II

You are given a string s consisting of lowercase English letters and the special characters: '*', '#', and '%'. You are also given an integer k. Build a new string result by processing s according to the following rules from left to right: If the letter is a lowercase English letter append it to result. A '*' removes the last character from result, if it exists. A '#' duplicates the current result and appends it to itself. A '%' reverses the current result. Return the kth character of the final string result. If k is out of the bounds of result, return '.'.
/**
 * @param {string} s
 * @param {number} k
 * @return {character}
 */
var processStr = function(s, k) {
    const n = s.length;
    const len = new Array(n).fill(0);

    // Forward: compute lengths
    for (let i = 0; i < n; i++) {
        const c = s[i];
        if (c >= 'a' && c <= 'z') {
            len[i] = (i > 0 ? len[i-1] : 0) + 1;
        } else if (c === '*') {
            len[i] = Math.max(0, (i > 0 ? len[i-1] : 0) - 1); 
        } else if (c === '#') {
            len[i] = (i > 0 

Codice Fiscale Italiano Regex

```
^[A-Za-z]{6}[0-9]{2}[A-Za-z][0-9]{2}[A-Za-z][0-9]{3}[A-Za-z]$
```