Skip to content

Instantly share code, notes, and snippets.

@maudzekod4000
maudzekod4000 / aoc2024-1-1.cpp
Created December 10, 2024 21:12
Advent Of Code 2024 Day 1 - Problem 1
#include <iostream>
#include <fstream>
#include <string>
#include <ctype.h>
#include <vector>
#include <algorithm>
#include <sstream>
using namespace std;
@maudzekod4000
maudzekod4000 / rust.cpp
Created March 8, 2024 14:04
Simulation of metal piece rusting
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <unordered_set>
static const int dim = 10;
std::string readLine(std::istream& in) {
std::string str;
@maudzekod4000
maudzekod4000 / character-finder.cpp
Created March 8, 2024 13:19
Program for finding words that contain a specific character
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <unordered_set>
std::string readLine(std::istream& in) {
std::string str;
std::getline(in, str);
return str;
@maudzekod4000
maudzekod4000 / day.cpp
Created December 12, 2023 22:24
Advent of Code - Day 2
#include <iostream>
#include <fstream>
#include <string>
#include <ctype.h>
#include <vector>
#include <sstream>
using namespace std;
struct Game {
@maudzekod4000
maudzekod4000 / day1.cpp
Created December 12, 2023 08:34
Advent Of Code - Day 1
#include <iostream>
#include <fstream>
#include <string>
#include <ctype.h>
#include <math.h>
using namespace std;
int main()
{
#include <iostream>
#include <vector>
#include <math.h>
#include <unordered_map>
#include <string>
#include <fstream>
#include <stack>
#include <unordered_set>
#include <queue>
#include <stack>
@maudzekod4000
maudzekod4000 / ClosestPoint2D.cpp
Created September 19, 2022 07:22
Closest 2 points in 2D space
// Example program
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
using namespace std;
struct Point {
int x;
@maudzekod4000
maudzekod4000 / dijkstra.cpp
Created September 14, 2022 12:12
Dijkstra shortest path
#include <iostream>
#include <vector>
#include <math.h>
#include <unordered_map>
#include <string>
#include <fstream>
#include <stack>
#include <unordered_set>
#include <queue>
#include <stack>
@maudzekod4000
maudzekod4000 / dfs-all-paths-dest.cpp
Last active August 29, 2022 08:57
DFS All paths to destination
#include <iostream>
#include <vector>
#include <math.h>
#include <unordered_map>
#include <string>
#include <fstream>
#include <stack>
using namespace std;
unordered_map<int, vector<int>> graph;
#include <iostream>
#include <vector>
#include <future>
#include <unordered_map>
#include <unordered_set>
using namespace std;
/* A DS for finding the root node of a vertex in a tree.
!Does not keep track of the original tree structure so it cannot be reconstructed exactly. */