Skip to content

Instantly share code, notes, and snippets.

View itachi-19's full-sized avatar
🏠
Working from home

Itachi itachi-19

🏠
Working from home
View GitHub Profile
@itachi-19
itachi-19 / elevator.cpp
Created March 2, 2025 12:36
Dynamic Programming with Bitmasks - CSES Elevator Rides
#include <bits/stdc++.h>
using namespace std;
int getMinTrips(int n, int x, vector<int> w) {
int limit = 1 << n;
vector<pair<int,int>> dp(limit, {n + 1, 0});
dp[0] = {1, 0};
for (int s=1; s < limit; s++) {
for (int person=0; person < n; person++) {
@itachi-19
itachi-19 / projecteuler_22v1.sh
Created January 26, 2025 09:00
ProjectEuler - #22 - Names Scores
#!/bin/bash
sed 's/"//g;s/,/\n/g' 0022_names.txt |
sort |
gawk '
BEGIN { S = 0 }
{
sum = 0
for (i = 1; i <= length($0); i++) {
@itachi-19
itachi-19 / folder_cleanup.go
Last active January 26, 2025 08:34
Go Folder Cleanup Script
package main
import (
"fmt"
"io"
"log"
"os"
"path/filepath"
"slices"
)
Tom Day - Who we want to be
https://www.youtube.com/watch?v=BVomQtrtMTM
https://www.youtube.com/watch?v=BVomQtrtMTM&lc=Ugw022qkAst7FWtdQl54AaABAg
Someone posted a story here a long time ago. Now I can't find that comment anymore. He deleted it, and with it, one hell of a good story. It took some time to find it, but now I have.