CodingSpace

[HackerRank/Algorithms] Warmup - Solve Me First 본문

HackerRank/Algorithm

[HackerRank/Algorithms] Warmup - Solve Me First

개발자_조이킴 2022. 8. 18. 09:05

Problem. Warmup - Solve Me First


Link.

https://www.hackerrank.com/challenges/solve-me-first/problem?isFullScreen=true 

 

Solve Me First | HackerRank

This is an easy challenge to help you start coding in your favorite languages!

www.hackerrank.com


Description.

Complete the function solveMeFirst to compute the sum of two integers.

 


Key Point. 


My Answer. 

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

var input_stdin = "";
var input_stdin_array = "";
var input_currentline = 0;

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

process.stdin.on('end', function () {
    input_stdin_array = input_stdin.split("\n");
    main();    
});

function readLine() {
    return input_stdin_array[input_currentline++];
}

function solveMeFirst(a, b) {
  // Hint: Type return a+b below   
  return a + b;
}


function main() {
    var a = parseInt(readLine());
    var b = parseInt(readLine());;

    var res = solveMeFirst(a, b);
    console.log(res);
}

References. 

 

Comments