Skip to content

Instantly share code, notes, and snippets.

View tungurlakachakcak's full-sized avatar
🐈
Miay

tungurlakachakcak

🐈
Miay
View GitHub Profile
@tungurlakachakcak
tungurlakachakcak / 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;
@tungurlakachakcak
tungurlakachakcak / 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;
@tungurlakachakcak
tungurlakachakcak / 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 {
@tungurlakachakcak
tungurlakachakcak / 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>
@tungurlakachakcak
tungurlakachakcak / 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;
@tungurlakachakcak
tungurlakachakcak / 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>
@tungurlakachakcak
tungurlakachakcak / 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. */
@tungurlakachakcak
tungurlakachakcak / ShoppingList.cpp
Created January 4, 2022 00:21
Code kata for a order list
#include <iostream>
#include <cstdint>
#include <vector>
#include <limits>
#include <cstring>
#include <sstream>
#include <chrono>
#include <set>
#include <stack>
#include <map>