3720. Lexicographically Smallest Permutation Greater Than Target

You are given two strings s and target, both having length n, consisting of lowercase English letters. Return the lexicographically smallest permutation of s that is strictly greater than target. If no permutation of s is lexicographically strictly greater than target, return an empty string. A string a is lexicographically strictly greater 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 later in the alphabet than the corresponding letter in b.
/**
 * @param {string} s
 * @param {string} target
 * @return {string}
 */
var lexGreaterPermutation = function (s, target) {
    const n = s.length;

    // Frequency of each character in s: index 0 -> 'a', ..., 25 -> 'z'
    const freq = Array(26).fill(0);
    for (const ch of s) {
        freq[ch.charCodeAt(0) - 97]++;
    }

    // Answer we are constructing
    const ans = Array(n).fill('');

    /**
     * Step 1: Try to make ans equal to target as long as possible.
     * Returns the firs

Insufficient system resources exist to complete the requested service / Windows Resource Protection could not perform the requested operati

## Symptoms

|Command|Return|ReturnCode|
|---|---|---|
|DISM.exe|Insufficient system resources exist to complete the requested service.|1450|
|SFC.exe|Windows Resource Protection could not perform the requested operation.||

```0x800705AA: ERROR_NO_SYSTEM_RESOURCES```<br>
```0xC000009A: STATUS_INSUFFICIENT_RESOURCES```

## Cause

COMPONENTS registry hive was so large that additional entries could not be written.

## Resolution

#### Step 1: Export Oldest VersionedIndex Registry Keys (to regain t

HeidiSQL - Testovací procedura

DROP PROCEDURE IF EXISTS moja_test_procedura;

DELIMITER //

CREATE PROCEDURE moja_test_procedura()
BEGIN
    -- 1. Deklarace handleru MUSÍ být na začátku bloku BEGIN
    DECLARE EXIT HANDLER FOR SQLEXCEPTION
    BEGIN
        ROLLBACK;
        SELECT 'Chyba! Transakce byla zrušena.' AS Vysledek;
    END;

    -- 2. Logika transakce
    START TRANSACTION;

    INSERT INTO icon_list VALUES (555, 'test', 'aaa');
    INSERT INTO icon_list VALUES (555, 'test', 'aaa');

    COMMIT;

Run Django Python script in Powershell (outside PyCharm)

# Run Django Python script in Powershell (outside PyCharm)

- Navigate to project root folder
- Activate virtual environment: -`.venv\Scripts\Activate.ps1`
- Run the script as a module using the `-m` flag and `.`` instead of ``\`: `python -m app.folder.script_name`
- Deactivate virtual environment: `deactivate`

2904. Shortest and Lexicographically Smallest Beautiful String

You are given a binary string s and a positive integer k. A substring of s is beautiful if the number of 1's in it is exactly k. Let len be the length of the shortest beautiful substring. Return the lexicographically smallest beautiful substring of string s with length equal to len. If s doesn't contain a beautiful substring, return an empty string. A string a is lexicographically larger than a string b (of the same length) if in the first position where a and b differ, a has a character strictly larger than the corresponding character in b. For example, "abcd" is lexicographically larger than "abcc" because the first position they differ is at the fourth character, and d is greater than c.
/**
 * @param {string} s
 * @param {number} k
 * @return {string}
 */
var shortestBeautifulSubstring = function(s, k) {
    let n = s.length;
    let left = 0;
    let count1 = 0;
    let best = "";  // store lexicographically smallest among shortest

    for (let right = 0; right < n; right++) {
        if (s[right] === '1') count1++;

        // When we have exactly k ones, try shrinking from the left
        while (count1 === k) {
            let candidate = s.slice(left, right + 1);

       

JWT dependencies

    implementation("io.jsonwebtoken:jjwt-api:0.12.5")
    runtimeOnly("io.jsonwebtoken:jjwt-impl:0.12.5")
    runtimeOnly("io.jsonwebtoken:jjwt-jackson:0.12.5")

3718. Smallest Missing Multiple of K

Given an integer array nums and an integer k, return the smallest positive multiple of k that is missing from nums. A multiple of k is any positive integer divisible by k.
/**
 * @param {number[]} nums
 * @param {number} k
 * @return {number}
 */
var missingMultiple = function(nums, k) {
    // Use a Set for O(1) membership checks
    const seen = new Set(nums);

    // Start from the first positive multiple of k
    let m = k;

    // Keep checking multiples of k until one is not in nums
    while (seen.has(m)) {
        m += k;   // Move to the next multiple
    }

    // This is the smallest missing multiple
    return m;
};

genspark skils

<skill_content name="app-development-dashboard">
# Skill: app-development-dashboard

# Dashboard Development Guide

Build multi-chart dashboards with KPI cards on the **B-Suite design system**.
Assumes you have already activated the base `app-development` skill.

## Inherit the design system (do NOT inline CSS)

Declare a palette on `<html>` and the platform injects the whole B-Suite design
system at serve time — design tokens, 9 palettes (light + dark), the component
CSS, and a JS r

1872. Stone Game VIII

Alice and Bob take turns playing a game, with Alice starting first. There are n stones arranged in a row. On each player's turn, while the number of stones is more than one, they will do the following: Choose an integer x > 1, and remove the leftmost x stones from the row. Add the sum of the removed stones' values to the player's score. Place a new stone, whose value is equal to that sum, on the left side of the row. The game stops when only one stone is left in the row. The score difference between Alice and Bob is (Alice's score - Bob's score). Alice's goal is to maximize the score difference, and Bob's goal is the minimize the score difference. Given an integer array stones of length n where stones[i] represents the value of the ith stone from the left, return the score difference between Alice and Bob if they both play optimally.
/**
 * @param {number[]} stones
 * @return {number}
 */
var stoneGameVIII = function(stones) {
    const n = stones.length;

    // Build prefix sums: pref[i] = sum of stones[0..i]
    // These represent the score Alice would gain if she removes up to index i.
    const pref = new Array(n);
    pref[0] = stones[0];
    for (let i = 1; i < n; i++) {
        pref[i] = pref[i - 1] + stones[i];
    }

    // dp[i] = best score difference Alice can guarantee
    // starting from the state where she h

view transition apiを利用する

遷移前、遷移後でトランジションさせたい同一要素に対して<br> 「view-transition-name」プロパティで固有の名前を合わせて付与させる。<br> ※このとき、値が一意じゃないと動作しないので注意
@view-transition {
	navigation: auto;
}

usefull houdini hip

https://codercat.xyz/cookbook/recipes/

1927. Sum Game

Alice and Bob take turns playing a game, with Alice starting first. You are given a string num of even length consisting of digits and '?' characters. On each turn, a player will do the following if there is still at least one '?' in num: Choose an index i where num[i] == '?'. Replace num[i] with any digit between '0' and '9'. The game ends when there are no more '?' characters in num. For Bob to win, the sum of the digits in the first half of num must be equal to the sum of the digits in the second half. For Alice to win, the sums must not be equal. For example, if the game ended with num = "243801", then Bob wins because 2+4+3 = 8+0+1. If the game ended with num = "243803", then Alice wins because 2+4+3 != 8+0+3. Assuming Alice and Bob play optimally, return true if Alice will win and false if Bob will win.
/**
 * @param {string} num
 * @return {boolean}
 */
var sumGame = function(num) {
    const n = num.length;
    const half = n / 2;

    let Lsum = 0, Rsum = 0;
    let Lq = 0, Rq = 0;

    for (let i = 0; i < half; i++) {
        if (num[i] === '?') Lq++;
        else Lsum += num.charCodeAt(i) - 48;
    }

    for (let i = half; i < n; i++) {
        if (num[i] === '?') Rq++;
        else Rsum += num.charCodeAt(i) - 48;
    }

    // If odd number of question marks, Alice wins automatically
   

Activate Django in Python script


# ================================================================
# ======  For local testing purposes only- activate Django  ======
# ================================================================

import os
import django

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project_name.settings")
django.setup()

# ================================================================
# ======          End of Django activaion setup             ====== 
# =================================

3622. Check Divisibility by Digit Sum and Product

You are given a positive integer n. Determine whether n is divisible by the sum of the following two values: The digit sum of n (the sum of its digits). The digit product of n (the product of its digits). Return true if n is divisible by this sum; otherwise, return false.
/**
 * @param {number} n
 * @return {boolean}
 */
var checkDivisibility = function(n) {
    // Convert the number to a string so we can iterate through each digit
    let sum = 0;
    let prod = 1;

    // Loop through each character (digit) in the number
    for (const ch of String(n)) {
        const d = ch - '0';   // Convert character to actual digit
        sum += d;             // Add digit to the running sum
        prod *= d;            // Multiply digit into the running product
    }

 

Check user password / Django

import os
import django
from django.contrib.auth import get_user_model

# Start Django setup
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Django_project_4.settings")
django.setup()
# End of djang o setup


User = get_user_model()

# Find user by username or email
user = User.objects.get(username="username")
# user = User.objects.get(email="email@email.com")
password = "password"

if user.check_password(password):
    print("Password match!")
else:
    print("Wrong passwor