Skip to content

Instantly share code, notes, and snippets.

View thatsumoguy's full-sized avatar

thatsumoguy thatsumoguy

View GitHub Profile
public static string PartOne(string input)
{
var grid = input.Split('\n');
var startRow = 0;
var startCol = grid[startRow].IndexOf('.');
var blizzardsMap = new Dictionary<int, HashSet<(int x, int y)>>();
var maxStep = (grid.Length - 2) * (grid[0].Length - 2) + 1;
for(var step = 0; step < maxStep; step++)
{
var blizzards = new HashSet<(int x, int y)>();
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Linq;
using System.Diagnostics;
namespace AdventOfCode2021
{
class Day24
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using System.IO;
using System.Diagnostics;
namespace AdventOfCode2021
{
class Day21
##..#..##.#..#...####..#.#..##.###.......###.###..#..######...#.#....#...##.###.......#.#..####.#..#......#.#...##.#..##.#.##.#..####.#..##.....#.....#....###.#.#....##..##.##.####.##.###..###..####..#.#.#####..#####.####..######.##....#..#.#...#..##..###....#...#####.#..###...##..#.######..#.##.#....######.....###..##..######.....#..##.##..#.###...####.#...#.##.#.#....####.##.###...####.#.#.#.###..##..##....#.#.#..###.##.###..##.#...##.#.#####.#..#...####..###.###...###.#..#..##.#...#....##.#....##...##.#.
#..##.#..#.##..#.#.##...##.####.....#..#.#######.#.####.##.#.#......#.#..####.#..#####.#...###..###.
.#...#...#..###.#..#.......########..###...###.#....######.#.#..##..#..###..####.#.#..#..#..#.#.#..#
#.##....#.###..#.#....###..#....##.##..#####.###.#.#.....#.###...#.#..#.###.##..##..#..#..#########.
.#######.##.#########.#..###...#..#.###...##..#.#########..#.##.#.##..###..##.#.###..##.#.###.#..#..
#......####.#.....###..#...####.####.###...#.##.##.##.....#.#..#....#..###.....##.#.#...###.##.##.##
...##
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Linq;
using System.Diagnostics;
namespace AdventOfCode2021
{
class Day20
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Linq;
using System.Diagnostics;
namespace AdventOfCode2021
{
class Day16
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Linq;
using System.Diagnostics;
namespace AdventOfCode2021
{
class Day14
public static int PartTwo(string[] input)
{
var lines = File.ReadAllText(@"C:\Users\{name}\source\repos\Advent of Code 2020\Advent of Code 2020\Input\Day4.txt");
var passports = lines.Split(new string[] { Environment.NewLine, Environment.NewLine }, StringSplitOptions.None).ToList();
var valid = 0;
var validPass = new List<bool>();
foreach (var pass in passports)
{
if(pass == "")
{