-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from sir-gon/feature/solve-me-first
[Hacker Rank]: Solve Me First solved ✓
- Loading branch information
Showing
3 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
algorithm-exercises-csharp-test/src/hackerrank/warmup/SolveMeFirst.Test.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace algorithm_exercises_csharp; | ||
|
||
[TestClass] | ||
public class SolveMeFirstTest | ||
{ | ||
[TestMethod] | ||
public void TestSolveMeFirst() | ||
{ | ||
int expectedAnswer = 5; | ||
int a = 2; | ||
int b = 3; | ||
int result = SolveMeFirst.solveMeFirst(a, b); | ||
|
||
Assert.AreEqual(expectedAnswer, result); | ||
|
||
} | ||
} | ||
|
15 changes: 15 additions & 0 deletions
15
algorithm-exercises-csharp/src/hackerrank/warmup/SolveMeFirst.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
namespace algorithm_exercises_csharp; | ||
|
||
using System.Diagnostics.CodeAnalysis; | ||
|
||
public class SolveMeFirst | ||
{ | ||
[ExcludeFromCodeCoverage] | ||
protected SolveMeFirst() { } | ||
|
||
public static int solveMeFirst(int _a, int _b) | ||
{ | ||
return _a + _b; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# [Solve Me First](https://www.hackerrank.com/challenges/solve-me-first) | ||
|
||
Difficulty: #easy | ||
Category: #warmup | ||
|
||
Complete the function solveMeFirst to compute the sum of two integers. | ||
|
||
## Example | ||
|
||
$ a = 7 $ \ | ||
$ b = 3 $ | ||
|
||
Return 10. | ||
|
||
## Function Description | ||
|
||
Complete the solveMeFirst function in the editor below. | ||
solveMeFirst has the following parameters: | ||
|
||
- int a: the first value | ||
- int b: the second value | ||
|
||
## Constraints | ||
|
||
$ 1 \leq a, b \leq 1000 $ | ||
|
||
## Sample Input | ||
|
||
```text | ||
a = 2 | ||
b = 3 | ||
``` | ||
|
||
## Sample Output | ||
|
||
```text | ||
5 | ||
``` | ||
|
||
## Explanation | ||
|
||
```text | ||
2 + 3 = 5 | ||
``` |