In this HackerRank Solve Me First problem you need to complete the function solveMeFirst that has two parameters a and b and need to return the sum of a and b.

HackerRank Solve Me First problem solution


Problem solution in Python programming.

def solveMeFirst(a,b):
    return a+b


num1 = int(input())
num2 = int(input())
res = solveMeFirst(num1,num2)
print(res)


Problem solution in Java Programming.

import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

public class Solution {

    static int solveMeFirst(int a, int b) {
        return a+b;
   }

   
 public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int _a = in.nextInt();
        int _b = in.nextInt();
        int sum = solveMeFirst(_a, _b);
        System.out.println(sum);
   }
}


Problem solution in C++ programming.

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;


int solveMeFirst(int a, int b) {
  return a+b;
}
int main() {
  int num1, num2;
  int sum;
  cin>>num1>>num2;
  sum = solveMeFirst(num1,num2);
  cout<<sum;
  return 0;
}


Problem solution in C programming.

#include <stdio.h>
#include <stdlib.h>


int main() {
  int num1,num2,sum;
  scanf("%d %d",&num1,&num2);
  sum = num1+num2;
  printf("%d",sum);
  return 0;
}


Problem solution in JavaScript programming.

process.stdin.resume();
process.stdin.setEncoding('ascii');

var input = "";

process.stdin.on('data', function (data) {
    input += data;
});


process.stdin.on('end', function () {
    var inputArray = input.split("\n");
    var res;
    var a = parseInt(inputArray[0], 10);
    var b = parseInt(inputArray[1], 10);
    console.log(a+b);
  
});