Group Anagrams

https://leetcode.com/problems/group-anagrams/
class Solution {
    public List<List<String>> groupAnagrams(String[] strs) {
        List<List<String>> groups = new ArrayList<>();
        Map<String, List<String>> map = new HashMap<>();
        for(int i = 0; i < strs.length; i++) {
            String sortedKeyString = sortString(strs[i]);
            if (map.containsKey(sortedKeyString)) {
                map.get(sortedKeyString).add(strs[i]);
            } else {
                List<String> newGroup = new ArrayList<>();
        

2138. Divide a String Into Groups of Size k

A string s can be partitioned into groups of size k using the following procedure: The first group consists of the first k characters of the string, the second group consists of the next k characters of the string, and so on. Each element can be a part of exactly one group. For the last group, if the string does not have k characters remaining, a character fill is used to complete the group. Note that the partition is done so that after removing the fill character from the last group (if it exists) and concatenating all the groups in order, the resultant string should be s. Given the string s, the size of each group k and the character fill, return a string array denoting the composition of every group s has been divided into, using the above procedure.
/**
 * @param {string} s
 * @param {number} k
 * @param {character} fill
 * @return {string[]}
 */
var divideString = function(s, k, fill) {
    const result = [];

    // Loop through the string in increments of k
    for (let i = 0; i < s.length; i += k) {
        // Get a substring of length k starting from index i
        let group = s.slice(i, i + k);

        // If the group is shorter than k, pad it with the fill character
        if (group.length < k) {
            group = group.padEnd(k

Advanced Patterns: Mixins and Composition

// https://medium.com/@genildocs/mastering-object-oriented-programming-in-javascript-from-zero-to-hero-c718c3182eba

// Mixin for logging functionality
const LoggerMixin = {
  log(message) {
    console.log(`[${this.constructor.name}] ${message}`);
  },

  logError(error) {
    console.error(`[${this.constructor.name}] ERROR: ${error}`);
  }
};

// Mixin for validation
const ValidatorMixin = {
  validate(data, rules) {
    for (const [field, rule] of Object.entries(rules)) {
   

Spiral Matrix

https://leetcode.com/problems/spiral-matrix/description/
class Solution {
    public static List<Integer> spiralOrder(int[][] mat) {
        List<Integer> result = new ArrayList<Integer>();
        int n = mat.length;
        int m = mat[0].length;

        int top = 0;
        int left = 0;
        int right = m - 1; 
        int bottom = n - 1;

        while (top <= bottom && left <= right) {
            // Traverse right
            for (int i = left; i <= right; i++) {
                result.add(mat[top][i]);
            }
       

3085. Minimum Deletions to Make String K-Special

You are given a string word and an integer k. We consider word to be k-special if |freq(word[i]) - freq(word[j])| <= k for all indices i and j in the string. Here, freq(x) denotes the frequency of the character x in word, and |y| denotes the absolute value of y. Return the minimum number of characters you need to delete to make word k-special.
/**
 * Returns the minimum number of deletions required to make the string k-special.
 * A string is k-special if the difference between the frequencies of any two characters 
 * is at most k.
 *
 * @param {string} word - The input string.
 * @param {number} k - The allowed max difference between frequencies.
 * @return {number} - The minimum deletions needed.
 */
var minimumDeletions = function(word, k) {
    const freq = new Array(26).fill(0); // Frequency array for lowercase a-z.

    for (le

Group Anagrams

https://leetcode.com/problems/group-anagrams/description/
class Solution {
    public List<List<String>> groupAnagrams(String[] strs) {
        List<List<String>> groups = new ArrayList<>();
        Map<String, List<String>> map = new HashMap<>();
        for(int i = 0; i < strs.length; i++) {
            String sortedKeyString = sortString(strs[i]);
            if (map.containsKey(sortedKeyString)) {
                map.get(sortedKeyString).add(strs[i]);
            } else {
                List<String> newGroup = new ArrayList<>();
        

VPS comandos

### Matar procesos del chrome

En el VPS de los bots de JM

```bash
pkill -f chrome
```

### Correr Bun

```bash
bun src/bot.ts
```

### Revisar memoria y procesos

```bash
top
```

Reactivity in composables

<template>
  <TheBase :state="state" />
</template>


<script setup>
import { ref } from 'vue'
import TheBase from './TheBase.vue'


const state = ref(111)

setTimeout(() => {
  state.value = 222
}, 2000)
</script>

fn_get_blob_dblink - Pegar Blob via DBLINK

CREATE OR REPLACE FUNCTION fn_get_blob_dblink(
  I_DBLINK   VARCHAR2,
  I_TABELA   VARCHAR2,
  I_BLOB_COL VARCHAR2,
  I_RID      UROWID
) RETURN BLOB
IS
  -- Autor: Hallan Christian
  -- Função para buscar BLOB remotamente via DBLink em partes (chunks)
  
  C_CHUNK_SIZE CONSTANT PLS_INTEGER := 2000;
  V_CHUNK      RAW(2000);
  V_BLOB       BLOB;
  V_POS        PLS_INTEGER := 1;
BEGIN
  LOOP
    EXECUTE IMMEDIATE
    (
      'SELECT DBMS_LOB.SUBSTR@' || I_DBLINK || '(' || I_BLOB

B2 Unit18

it has been good
it has gone well
it has 
the 
build up 
goes 

E
1. If she hadn't worn high heels, she wouldn't have fallen down the stairs.
2. If we had known there was a dress code, we would have dressed up for the occasion.
3. If I had been into Nirvana, I would have loved the grunge style.
4. I would have looked trendy If I had bought the dress from a fancy shop.
5. I he had had a big enough wardrobe, there would have been enough space for the new suits.
6. If she hadn't quit h

3443. Maximum Manhattan Distance After K Changes

You are given a string s consisting of the characters 'N', 'S', 'E', and 'W', where s[i] indicates movements in an infinite grid: 'N' : Move north by 1 unit. 'S' : Move south by 1 unit. 'E' : Move east by 1 unit. 'W' : Move west by 1 unit. Initially, you are at the origin (0, 0). You can change at most k characters to any of the four directions. Find the maximum Manhattan distance from the origin that can be achieved at any time while performing the movements in order. The Manhattan Distance between two cells (xi, yi) and (xj, yj) is |xi - xj| + |yi - yj|.
/**
 * Calculates the maximum Manhattan distance from the origin
 * that can be achieved while moving in a grid, with the option
 * to change up to 'k' directions.
 *
 * @param {string} s - String of movement directions: 'N', 'S', 'E', 'W'.
 * @param {number} k - Number of allowed direction changes.
 * @return {number} - Maximum distance from the origin at any point.
 */
var maxDistance = function(s, k) {
    let x = 0, y = 0;       // Current coordinates on the grid
    let maxDist = 0;        

/set-role/route.ts

import { NextResponse } from 'next/server'
import { createClient } from '@supabase/supabase-js'

const supabaseAdmin = createClient(
  process.env.NEXT_PUBLIC_SUPABASE_URL!,
  process.env.SUPABASE_SERVICE_ROLE_KEY! // ⚠️ Service role key uniquement côté serveur
)

export async function POST(req: Request) {
  try {
    const body = await req.json()
    const { userId, role, firstName, lastName } = body

    if (!userId || !role) {
      return NextResponse.json({ error: "userId et role sont requi

Allow to user choice between continue or stop an execution

# pause and allow the selection between continue or stop
while True:
    answer = input("Would you like to continue (C) or stop (S)? ").strip().lower()
    if answer == 'c':
        print("Continue...")
        break
    elif answer == 's':
        print("Stop.")
        exit()
    else:
        print("Not allowed answer.")

learning

kafka:
https://learn.conduktor.io/kafka/kafka-topics/

pretzel (python, api)
https://www.pretzellogix.net/2021/12/08/step-1-read-the-docs-and-use-postman-to-understand-the-rest-api/

Js starter file - ascend

<script>
    // make sure to import your icon CDN script first
    // Services icon swap (this is a quick way to replace system icons with FontAwesome icons
    jQuery('.products-services[about*="/tax-planning"] .thumbnail').empty().append('<i class="fa-solid fa-sharp icon-4x text-center fa-pie-chart"></i>');
  
    jQuery('.products-services[about*="/products-services/retirement-planning"] .thumbnail').empty().append('<i class="fa-solid fa-sharp icon-4x text-center fa-compass"></i>');
    
    

css starter file - ascend - June 2025

/* @import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap');

:root {
  --h1-font-family: "DM Sans", sans-serif;
  --h2-font-family: "DM Sans", sans-serif;
  --h3-font-family: "DM Sans", sans-serif;
  --h4-font-family: "DM Sans", sans-serif;
  --body-font-family: "DM Sans", sans-serif;
  --link-font-family: "DM Sans", sans-serif;
  --button-font-family: "DM Sans", sans-serif;
} */

h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5,