Skip to content

Commit 9ed5a56

Browse files
author
Gonzalo Diaz
committed
WIP
1 parent 5b4c42c commit 9ed5a56

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

src/algorithm_exercises_csharp/hackerrank/interview_preparation_kit/dictionaries_and_hashmaps/RansomNote.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static bool checkMagazineCompute(List<string> magazine, List<string> note
5353
throw new InvalidValueException("Value can't go below 0");
5454
}
5555
}
56-
catch
56+
catch (InvalidValueException)
5757
{
5858
return false;
5959
}

src/algorithm_exercises_csharp/hackerrank/interview_preparation_kit/greedy_algorithms/LuckBalance.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ public class Competition(int _luck, int _important)
1414

1515
public static int luckBalance(int k, List<List<int>> contests)
1616
{
17+
ArgumentNullException.ThrowIfNull(contests);
18+
1719
List<Competition> important_competitions = [];
1820
List<Competition> nonimportant_competitions = [];
1921

src/algorithm_exercises_csharp_test/hackerrank/interview_preparation_kit/linked_list/FindMergeNode.Test.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace algorithm_exercises_csharp_test.hackerrank.interview_preparation_kit.l
55
[TestClass]
66
public class FindMergeNodeTest
77
{
8-
class FindMergeNodeTestCase()
8+
private sealed class FindMergeNodeTestCase()
99
{
1010
public string title = "";
1111
public LinkedList<int>.Node llist1 = new(0);
@@ -81,7 +81,8 @@ public void testLinkedListCycle()
8181
Assert.AreEqual(
8282
test.expected,
8383
result,
84-
String.Format(
84+
string.Format(
85+
System.Globalization.CultureInfo.InvariantCulture,
8586
"{0} findMergeNode({1}, {2}) => must be: {3}",
8687
test.title,
8788
test.llist1,

src/algorithm_exercises_csharp_test/hackerrank/interview_preparation_kit/linked_list/LinkedListCycle.Test.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace algorithm_exercises_csharp_test.hackerrank.interview_preparation_kit.l
55
[TestClass]
66
public class LinkedListCycleTest
77
{
8-
class LinkedListCycleTestCase
8+
private sealed class LinkedListCycleTestCase
99
{
1010
public string title = "";
1111
public LinkedList<string>.Node? llist;
@@ -65,6 +65,7 @@ public void testLinkedListCycle()
6565
test.expected,
6666
result,
6767
String.Format(
68+
System.Globalization.CultureInfo.InvariantCulture,
6869
"{0} testLinkedListCycle({1}) => must be: {2}",
6970
test.title,
7071
test.llist,

src/algorithm_exercises_csharp_test/hackerrank/interview_preparation_kit/linked_list/lib/Node.Test.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace algorithm_exercises_csharp_test.hackerrank.interview_preparation_kit.l
44
[TestClass]
55
public class NodeTest
66
{
7-
class NodeTestCase
7+
private sealed class NodeTestCase
88
{
99
public string title = "";
1010
public LinkedList<int>.Node? llist;

0 commit comments

Comments
 (0)