Skip to content

[REWRITE] Solve Me First readjusted to the problem statement. #158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* Solve Me First.
*
* @link Problem definition [[docs/hackerrank/SolveMeFirst.md]]
* @link Problem definition [[docs/hackerrank/warmup/solve_me_first.md]]
*/
public class SolveMeFirst {

Expand All @@ -14,17 +14,7 @@ private SolveMeFirst() {}
/**
* solveMeFirst.
*/
public static Integer solveMeFirst(Integer[] inputs) {

int total = 0;

for (Integer name : inputs) {
total += name;
}

String log = String.format("solveMeFirst solved: %d", total);
logger.info(log);

return total;
public static int solveMeFirst(int a, int b) {
return a + b;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ class SolveMeFirstTest {
@Test void solveMeFirst() {

Integer answer = 5;
Integer[] input = {2, 3};
Integer a = 2;
Integer b = 3;

Integer solutionFound = SolveMeFirst.solveMeFirst(input);
Integer solutionFound = SolveMeFirst.solveMeFirst(a, b);

assertEquals(answer, solutionFound,
String.format("Problem 0000 answer must be: %d", answer)
Expand Down
Loading