1320. Minimum Distance to Type a Word Using Two Fingers

You have a keyboard layout as shown above in the X-Y plane, where each English uppercase letter is located at some coordinate. For example, the letter 'A' is located at coordinate (0, 0), the letter 'B' is located at coordinate (0, 1), the letter 'P' is located at coordinate (2, 3) and the letter 'Z' is located at coordinate (4, 1). Given the string word, return the minimum total distance to type such string using only two fingers. The distance between coordinates (x1, y1) and (x2, y2) is |x1 - x2| + |y1 - y2|. Note that the initial positions of your two fingers are considered free so do not count towards your total distance, also your two fingers do not have to start at the first letter or the first two letters.
/**
 * @param {string} word
 * @return {number}
 */
var minimumDistance = function(word) {
    // Keyboard coordinates for A–Z
    const pos = {};
    const layout = [
        "ABCDEF",
        "GHIJKL",
        "MNOPQR",
        "STUVWX",
        "YZ"
    ];
    
    for (let r = 0; r < layout.length; r++) {
        for (let c = 0; c < layout[r].length; c++) {
            pos[layout[r][c]] = [r, c];
        }
    }

    const dist = (a, b) => {
        const [x1, y1] = pos[a];
        const [x2

unicorn - серврер

uvicorn server:app --port 8001 - запуск

venv -virtual environment (виртуальное окружение Python)

python3 -m venv venv - создать venv
source venv/bin/activate - активировать
which python - проверить
deactivate - выйти из venv

prompts

[Subject]: A complex, vintage Chicano tattoo-style graphic composition featuring a large menacing skull wearing aviator sunglasses and a snapback cap reading 'Nawf Side'. Below the skull is elaborate, ornate gothic typography reading 'TRILLA THAN THA REST' intertwined with decorative flowing ribbons. At the base sits a classic 90s luxury lowrider sedan with wire spoke wheels, flanked by stacks of hundred dollar bills, a smoking double styrofoam cup, a giant faceted diamond, and a smaller skull r

mcp config for lm studio

{
  "mcpServers": {
    "firecrawl-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "firecrawl-mcp"
      ],
      "env": {
        "FIRECRAWL_API_KEY": "fc-0b4d8657290a4ffdacee91bb1614089d"
      }
    },
    "exa": {
      "command": "npx",
      "args": [
        "-y",
        "exa-mcp-server"
      ],
      "env": {
        "EXA_API_KEY": "e030e9c4-3bbb-47d1-ae23-7f12dce7ed2a"
      }
    },
    "mem0-mcp": {
      "url": "https://mcp.mem0.ai/mcp"
    }
  }
}

3741. Minimum Distance Between Three Equal Elements II

You are given an integer array nums. A tuple (i, j, k) of 3 distinct indices is good if nums[i] == nums[j] == nums[k]. The distance of a good tuple is abs(i - j) + abs(j - k) + abs(k - i), where abs(x) denotes the absolute value of x. Return an integer denoting the minimum possible distance of a good tuple. If no good tuples exist, return -1.
/**
 * @param {number[]} nums
 * @return {number}
 */
var minimumDistance = function(nums) {
    const lastTwo = new Map(); // value -> [prevPrev, prev]
    let ans = Infinity;

    for (let i = 0; i < nums.length; i++) {
        const v = nums[i];

        if (!lastTwo.has(v)) {
            lastTwo.set(v, [i]); // first occurrence
            continue;
        }

        const arr = lastTwo.get(v);

        if (arr.length === 1) {
            // second occurrence
            arr.push(i);
      

claudtet-code-repoduces

Level Up Coding
You're reading for free via Fareed Khan's Friend Link. Become a member to access the best of Medium.

Member-only story



Building Claude Code with Harness Engineering
Multi-agents, MCP, skills system, context pipelines and more
Fareed Khan
Fareed Khan

Follow
78 min read
·
4 days ago
933


6



Read this story for free: link

As of early 2026, Claude Code crossed $1 billion in annualized revenue within six months of launch. It did not get there because of better prompts. It got

claudtet-code-repoduces

Level Up Coding
You're reading for free via Fareed Khan's Friend Link. Become a member to access the best of Medium.

Member-only story



Building Claude Code with Harness Engineering
Multi-agents, MCP, skills system, context pipelines and more
Fareed Khan
Fareed Khan

Follow
78 min read
·
4 days ago
933


6



Read this story for free: link

As of early 2026, Claude Code crossed $1 billion in annualized revenue within six months of launch. It did not get there because of better prompts. It got

AWS Trusted Advisor - Exposed IAM Access Keys

AWSTemplateFormatVersion: 2010-09-09
Description: Trusted Advisor - Exposed Access Key Detection & Alerting

Parameters:
  Organization:
    Description: Organization name being deployed to
    Type: String
    MinLength: 1

  NotificationHTTPS:
    Description: HTTPS (PagerDuty) Endpoint for SNS Topic Subscription
    Type: String
    MinLength: 1

Resources:

  ########################
  ## SNS TOPIC
  ########################

  SNSTopicAlerts:
    Type: AWS::SNS::Topic
    Properties:
      

3740. Minimum Distance Between Three Equal Elements I

You are given an integer array nums. A tuple (i, j, k) of 3 distinct indices is good if nums[i] == nums[j] == nums[k]. The distance of a good tuple is abs(i - j) + abs(j - k) + abs(k - i), where abs(x) denotes the absolute value of x. Return an integer denoting the minimum possible distance of a good tuple. If no good tuples exist, return -1.
/**
 * @param {number[]} nums
 * @return {number}
 */
var minimumDistance = function(nums) {
    const pos = new Map();

    // Collect positions for each value
    for (let i = 0; i < nums.length; i++) {
        if (!pos.has(nums[i])) pos.set(nums[i], []);
        pos.get(nums[i]).push(i);
    }

    let ans = Infinity;

    // For each value, check triples of consecutive indices
    for (const [val, arr] of pos.entries()) {
        if (arr.length < 3) continue;

        for (let i = 0; i + 2 <

CSS Anchor Nav Slider Effect

<nav>
  <a href="#">Home</a>
  <a href="#">About</a>
  <a href="#">Articles</a>
  <a href="#">Contact</a>
</nav>

CSSだけでmasonryをやる(grid-lane)

<div class="container">
  <img class="item" src="https://assets.codepen.io/221808/masonry_photo1.jpg" width="500" alt="" />
  <img class="item" src="https://assets.codepen.io/221808/masonry_photo2.jpg" width="500" alt="" />
  <img class="item" src="https://assets.codepen.io/221808/masonry_photo3.jpg" width="500" alt="" />
  <img class="item" src="https://assets.codepen.io/221808/masonry_photo4.jpg" width="500" alt="" />
  <img class="item" src="https://assets.codepen.io/221808/masonry_photo5.jpg

グラデーション付き角丸SVGを一筆書き表示アニメーション

<svg viewBox="-20 -20 440 840" class="svg" xmlns="http://www.w3.org/2000/svg">
  <defs>
    <linearGradient id="pathGradient" x1="0" y1="0" x2="0" y2="1">
      <stop offset="0%" stop-color="#FFD54F" />
      <stop offset="100%" stop-color="#FF6D00" />
    </linearGradient>
  </defs>
  <path
    class="svg-path"
    d="M 350,0 C 350,250 50,250 50,400 C 50,550 350,550 350,800"
    fill="none"
    stroke="url(#pathGradient)"
    stroke-width="40"
    stroke-linecap="round"
  />
</svg>

mongodb memory prompt

can you help me impliment an agent agnostic, platfom. With mongodb, JavaScript/Typescript,  that will have an agent running in the background and be the brains for this memory implientation, it needs to know when to save a memory, when to let a memory go from short to long term and when and if the memory needs to decay. there needs to be short, long term memory, and procedural memory and obsevational memory, and this system needs to intigrate in vanilla js , as well as with react, and nextjs. an

mongodb memory prompt

can you help me impliment an agent agnostic, platfom. With mongodb, JavaScript/Typescript,  that will have an agent running in the background and be the brains for this memory implientation, it needs to know when to save a memory, when to let a memory go from short to long term and when and if the memory needs to decay. there needs to be short, long term memory, and procedural memory and obsevational memory, and this system needs to intigrate in vanilla js , as well as with react, and nextjs. an

Ubuntu api

7f95b846-8777-421e-bddb-d131f54ab899