Skip to content

Commit 3345990

Browse files
author
Gonzalo Diaz
committed
[REFACTOR] "static" classes marked as static
1 parent 922b886 commit 3345990

24 files changed

+35
-97
lines changed

src/algorithm_exercises_csharp/hackerrank/interview_preparation_kit/arrays/ArraysLeftRotation.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@ namespace algorithm_exercises_csharp.hackerrank.interview_preparation_kit.arrays
44

55
using System.Diagnostics.CodeAnalysis;
66

7-
public class ArraysLeftRotation
7+
public static class ArraysLeftRotation
88
{
9-
[ExcludeFromCodeCoverage]
10-
protected ArraysLeftRotation() { }
11-
129
public const int FIRST_POSITION = 0;
1310

1411
/**

src/algorithm_exercises_csharp/hackerrank/interview_preparation_kit/arrays/CrushBruteForce.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@ namespace algorithm_exercises_csharp.hackerrank.interview_preparation_kit.arrays
55

66
using System.Diagnostics.CodeAnalysis;
77

8-
public class CrushBruteForce
8+
public static class CrushBruteForce
99
{
10-
[ExcludeFromCodeCoverage]
11-
protected CrushBruteForce() { }
12-
1310
private const int INITIALIZER = 0;
1411

1512
public static long arrayManipulation(int n, List<List<int>> queries)

src/algorithm_exercises_csharp/hackerrank/interview_preparation_kit/arrays/CrushOptimized.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ namespace algorithm_exercises_csharp.hackerrank.interview_preparation_kit.arrays
55

66
using System.Diagnostics.CodeAnalysis;
77

8-
public class CrushOptimized
8+
public static class CrushOptimized
99
{
10-
[ExcludeFromCodeCoverage]
11-
private CrushOptimized() { }
1210

1311
/**
1412
// arrayManipulation.

src/algorithm_exercises_csharp/hackerrank/interview_preparation_kit/arrays/TwoDArray.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@ namespace algorithm_exercises_csharp.hackerrank.interview_preparation_kit.arrays
44

55
using System.Diagnostics.CodeAnalysis;
66

7-
public class TwoDArray
7+
public static class TwoDArray
88
{
9-
[ExcludeFromCodeCoverage]
10-
protected TwoDArray() { }
11-
129
private static List<int> getHourGlass(List<List<int>> arr, int positionX, int positionY)
1310
{
1411
List<int> result = [];

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@ namespace algorithm_exercises_csharp.hackerrank.interview_preparation_kit.dictio
66

77
using System.Collections.Generic;
88

9-
public class CountTriplets
9+
public static class CountTriplets
1010
{
11-
[ExcludeFromCodeCoverage]
12-
protected CountTriplets() { }
13-
1411
public static long countTriplets(List<long> arr, long r)
1512
{
1613
ArgumentNullException.ThrowIfNull(arr);

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@ namespace algorithm_exercises_csharp.hackerrank.interview_preparation_kit.dictio
55
using System.Diagnostics.CodeAnalysis;
66
using System.Collections.Generic;
77

8-
public class CountTripletsBruteForce
8+
public static class CountTripletsBruteForce
99
{
10-
[ExcludeFromCodeCoverage]
11-
protected CountTripletsBruteForce() { }
12-
1310
public static long countTriplets(List<long> arr, long r)
1411
{
1512
ArgumentNullException.ThrowIfNull(arr);

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,23 @@ namespace algorithm_exercises_csharp.hackerrank.interview_preparation_kit.dictio
55
using System.Diagnostics.CodeAnalysis;
66
using System.Collections.Generic;
77

8-
public class RansomNote
8+
public static class RansomNote
99
{
10-
[ExcludeFromCodeCoverage]
11-
protected RansomNote() { }
12-
1310
public class InvalidValueException : Exception
1411
{
1512
// constructor for the InvalidAgeException class
1613
public InvalidValueException(string msg)
1714
{
1815
Console.WriteLine(msg);
1916
}
17+
18+
public InvalidValueException()
19+
{
20+
}
2021
}
2122

22-
private static readonly string __YES__ = "Yes";
23-
private static readonly string __NO__ = "No";
23+
private const string __YES__ = "Yes";
24+
private const string __NO__ = "No";
2425

2526
public static bool checkMagazineCompute(List<string> magazine, List<string> note)
2627
{

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ namespace algorithm_exercises_csharp.hackerrank.interview_preparation_kit.dictio
55
using System.Diagnostics.CodeAnalysis;
66
using System.Numerics;
77

8-
public class SherlockAndAnagrams
8+
public static class SherlockAndAnagrams
99
{
10-
[ExcludeFromCodeCoverage]
11-
protected SherlockAndAnagrams() { }
1210

1311
/**
1412
* factorial().

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,11 @@ namespace algorithm_exercises_csharp.hackerrank.interview_preparation_kit.dictio
44

55
using System.Diagnostics.CodeAnalysis;
66

7-
public class TwoStrings
7+
public static class TwoStrings
88
{
9-
[ExcludeFromCodeCoverage]
10-
protected TwoStrings() { }
11-
12-
private static readonly string __YES__ = "Yes";
13-
private static readonly string __NO__ = "No";
14-
private static readonly char __EMPTY_CHAR__ = '\0';
9+
private const string __YES__ = "Yes";
10+
private const string __NO__ = "No";
11+
private const char __EMPTY_CHAR__ = '\0';
1512

1613
public static bool twoStringsCompute(string s1, string s2)
1714
{

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,14 @@ namespace algorithm_exercises_csharp.hackerrank.interview_preparation_kit.greedy
44

55
using System.Diagnostics.CodeAnalysis;
66

7-
public class LuckBalance
7+
public static class LuckBalance
88
{
99
public class Competition(int _luck, int _important)
1010
{
1111
public int luck => _luck;
1212
public int important => _important;
1313
}
1414

15-
[ExcludeFromCodeCoverage]
16-
protected LuckBalance() { }
17-
1815
public static int luckBalance(int k, List<List<int>> contests)
1916
{
2017
ArgumentNullException.ThrowIfNull(contests);

0 commit comments

Comments
 (0)