cleanup
This commit is contained in:
@@ -25,7 +25,9 @@ internal class CampCleanup : Problem<int, int>
|
|||||||
.Chunk(2)
|
.Chunk(2)
|
||||||
.Select(r => new Range(r.First(), r.Last()))
|
.Select(r => new Range(r.First(), r.Last()))
|
||||||
.First()
|
.First()
|
||||||
).Chunk(2).Select(pair => (pair.First(), pair.Last())).First();
|
).Chunk(2)
|
||||||
|
.Select(pair => (pair.First(), pair.Last()))
|
||||||
|
.First();
|
||||||
_pairs.Add((a, b));
|
_pairs.Add((a, b));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -64,6 +66,6 @@ internal class CampCleanup : Problem<int, int>
|
|||||||
return (B >= other.A && A <= other.A) || (A <= other.B && B >= other.B) || (A >= other.A && B <= other.B);
|
return (B >= other.A && A <= other.A) || (A <= other.B && B >= other.B) || (A >= other.A && B <= other.B);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static implicit operator Range((int a, int b) value) => new Range(value.a, value.b);
|
public static implicit operator Range((int a, int b) value) => new (value.a, value.b);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ public class AOCRunner
|
|||||||
Console.ForegroundColor = ConsoleColor.Green;
|
Console.ForegroundColor = ConsoleColor.Green;
|
||||||
Console.Write("Done in ");
|
Console.Write("Done in ");
|
||||||
Console.ForegroundColor = ConsoleColor.Cyan;
|
Console.ForegroundColor = ConsoleColor.Cyan;
|
||||||
Console.WriteLine($"{sw.ElapsedMilliseconds}ms");
|
Console.WriteLine($"{sw.Elapsed.TotalMilliseconds:n}ms");
|
||||||
}
|
}
|
||||||
catch (NotImplementedException)
|
catch (NotImplementedException)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user