Skip to content

Commit 490a998

Browse files
author
Gonzalo Diaz
committed
[Hacker Rank]: Solve Me First solved ✓
1 parent 43512e7 commit 490a998

File tree

3 files changed

+77
-0
lines changed

3 files changed

+77
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
namespace algorithm_exercises_csharp;
2+
3+
[TestClass]
4+
public class SolveMeFirstTest
5+
{
6+
[TestMethod]
7+
public void TestSolveMeFirst()
8+
{
9+
int expectedAnswer = 5;
10+
int a = 2;
11+
int b = 3;
12+
int result = SolveMeFirst.solveMeFirst(a, b);
13+
14+
Assert.AreEqual(expectedAnswer, result);
15+
16+
}
17+
}
18+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
namespace algorithm_exercises_csharp;
2+
3+
using System.Diagnostics.CodeAnalysis;
4+
5+
public class SolveMeFirst
6+
{
7+
[ExcludeFromCodeCoverage]
8+
protected SolveMeFirst() { }
9+
10+
public static int solveMeFirst(int _a, int _b)
11+
{
12+
return _a + _b;
13+
}
14+
15+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# [Solve Me First](https://www.hackerrank.com/challenges/solve-me-first)
2+
3+
Difficulty: #easy
4+
Category: #warmup
5+
6+
Complete the function solveMeFirst to compute the sum of two integers.
7+
8+
## Example
9+
10+
$ a = 7 $ \
11+
$ b = 3 $
12+
13+
Return 10.
14+
15+
## Function Description
16+
17+
Complete the solveMeFirst function in the editor below.
18+
solveMeFirst has the following parameters:
19+
20+
- int a: the first value
21+
- int b: the second value
22+
23+
## Constraints
24+
25+
$ 1 \leq a, b \leq 1000 $
26+
27+
## Sample Input
28+
29+
```text
30+
a = 2
31+
b = 3
32+
```
33+
34+
## Sample Output
35+
36+
```text
37+
5
38+
```
39+
40+
## Explanation
41+
42+
```text
43+
2 + 3 = 5
44+
```

0 commit comments

Comments
 (0)