Skip to content

Commit b4cab6a

Browse files
committed
fix: Map doesn't preserve order. Usage of basic Dictionary
1 parent b6261d1 commit b4cab6a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

solution/c#/Day14/Day14/LangExt/FizzBuzz.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ public static class FizzBuzz
77
private const int Min = 1;
88
private const int Max = 100;
99

10-
private static readonly Map<int, string> Mapping =
11-
Map.create(
12-
(15, "FizzBuzz"),
13-
(3, "Fizz"),
14-
(5, "Buzz")
15-
);
10+
private static readonly Dictionary<int, string> Mapping =
11+
new()
12+
{
13+
{ 15, "FizzBuzz" },
14+
{ 3, "Fizz" },
15+
{ 5, "Buzz" }
16+
};
1617

1718
public static Option<string> Convert(int input)
1819
=> IsOutOfRange(input)

0 commit comments

Comments
 (0)