Skip to content

Commit

Permalink
Merge pull request #29 from sir-gon/feature/solve-me-first
Browse files Browse the repository at this point in the history
[Hacker Rank]: Solve Me First solved ✓
  • Loading branch information
sir-gon authored May 16, 2024
2 parents 43512e7 + 490a998 commit 552fb15
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 0 deletions.
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 algorithm-exercises-csharp/src/hackerrank/warmup/SolveMeFirst.cs
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;
}

}
44 changes: 44 additions & 0 deletions docs/hackerrank/warmup/solve_me_first.md
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
```

0 comments on commit 552fb15

Please sign in to comment.