Skip to content

Instantly share code, notes, and snippets.

@nuoxoxo
nuoxoxo / getDailyChallenge.graphql
Last active January 26, 2024 15:18
GraphQL idea(s)
# GET leetcode.com/graphql
query getDailyChallenge {
activeDailyCodingChallengeQuestion {
date
link
question {
questionId
title
titleSlug
@nuoxoxo
nuoxoxo / cdg2O23.py.tpl
Created December 18, 2023 20:13
CDG - Template
import sys, math
creature_count = int(input())
for i in range(creature_count):
creature_id, color, _type = [int(j) for j in input().split()]
while True:
my_score, foe_score, my_scan_count = int(input()), int(input()), int(input())
print('my pts:', my_score, 'foe pts:', foe_score, '\nscan count:', my_scan_count, file=sys.stderr, flush=True)
@nuoxoxo
nuoxoxo / dc.md
Created December 5, 2023 08:26
docker cleanup
docker stop $(docker ps -aq) 
docker system prune --all
docker volume rm -f $(docker volume ls -q)
@nuoxoxo
nuoxoxo / gist:3bdc2e71b006bbcd8aea399c8a48378f
Last active December 25, 2022 09:47
Codingame FC 2022 - Boiler
import sys, math
C, R = [int(i) for i in input().split()] # boiler
# game loop
while True:
### boiler begins
my_matter, opp_matter = [int(i) for i in input().split()]
for i in range(height):
for j in range(width):
@nuoxoxo
nuoxoxo / Dining_Philosophers.MD
Last active September 15, 2022 21:58
The Pho Eaters & the Chopsticks They Shared
  • The
  • Dining
  • Philosopers
  • Problem

🗾 Map

step 1 :: checks & allocate

	- check_params
@nuoxoxo
nuoxoxo / Makefile
Created August 11, 2022 23:40
Party
party :
@printf "\033c"
@echo "\n\033[35m♪┏(・o・)┛♪"
@sleep 1
@printf "\033c"
@echo "\033[1;33m♪┗(・o・)┓♪"
@sleep 1
@printf "\033c"
@echo "\n\033[36m♪┏(・o・)┛♪"
@sleep 1
@nuoxoxo
nuoxoxo / quantum_spoons.md
Last active July 17, 2022 18:57
Quantum Spoons - The _NO_ Solution

Quantum Spoons - The NO Solution

malloc

pthread_mutex_t	*block_monitor;
block_monitor = (pthread_mutex_t *) malloc( sizeof(pthread_mutex_t) );

t_philo		*persons;
persons = (t_philo *) malloc( sizeof(t_philo) * 5 );
@nuoxoxo
nuoxoxo / philo.h
Last active July 17, 2022 21:50
Philosophers - Sim without soln
#include "stdlib.h"
#include "string.h"
#include "unistd.h" // time
#include "pthread.h"
#include "stdio.h"
typedef struct s_philo
{
int how_many_people;
int id; /* The philosopher's id: 0 to 5 */
@nuoxoxo
nuoxoxo / deque.h
Last active July 4, 2022 20:40
Deque Implementation in C
#ifndef DEQUE_H
# define DEQUE_H
# include "stdlib.h"
# include "stdio.h"
typedef struct s_deque
{
struct s_deque_node *head;
struct s_deque_node *tail;
int len;
@nuoxoxo
nuoxoxo / helloworld.md
Created December 28, 2021 22:47
Hello, World_
 _          _ _                            _     _ _
| |__   ___| | | ___   __      _____  _ __| | __| | |
| '_ \ / _ \ | |/ _ \  \ \ /\ / / _ \| '__| |/ _` | |
| | | |  __/ | | (_) |  \ V  V / (_) | |  | | (_| |_|
|_| |_|\___|_|_|\___/    \_/\_/ \___/|_|  |_|\__,_(_)