Skip to content

Instantly share code, notes, and snippets.

@bennidhamma
bennidhamma / unionfind.cs
Last active February 23, 2021 00:30 — forked from ashwath10110/unionfind.cs
Simple Union-Find Datastructure in C#
public class UF
{
public int[] id { get; set; }
public int[] sz { get; set; }
public int cnt { get; set; }
public UF(int N)
{
cnt = N;
@bennidhamma
bennidhamma / change.py
Created November 30, 2015 21:34 — forked from anonymous/change.py
Change making problem
def makeChange(price):
...
end
# Examples:
> makeChange(0.50)
< 2 Quarters
> makeChange(0.45)
< 2 Quarters, 1 Nickel