Skip to content

Instantly share code, notes, and snippets.

View guisantos's full-sized avatar
😎

guisantos

😎
View GitHub Profile
@guisantos
guisantos / MinWindow.cs
Last active October 11, 2023 21:09
Minimum Window Substring in C#
var s = "ADOBZASQWECCCODEBANCNMKLNJNCBA";
var substring = "ABC";
Console.WriteLine(MinWindow(s, substring));
string MinWindow(string s, string substring)
{
var subsDictionary = new Dictionary<char, int>();
var window = new Dictionary<char, int>();
@guisantos
guisantos / Floodfill.cs
Created October 11, 2023 20:34
Flood Fill Algorithm C#
int[,] canvas = new int[,]
{
{1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 0, 0},
{1, 0, 0, 1, 1, 0, 1, 1},
{1, 2, 2, 2, 2, 0, 1, 0},
{1, 1, 1, 2, 2, 0, 1, 0},
{1, 1, 1, 2, 2, 2, 2, 0},
{1, 1, 1, 1, 1, 2, 1, 1},
{1, 1, 1, 1, 1, 2, 2, 1}