1. Go to this page and download the library: Download shipu/hackerrank-api library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Shipu\HackerRank\Facades\HackerRank;
//..
//..
// Problem is returns the sum of two integers.
// Problem link: https://www.hackerrank.com/challenges/solve-me-first
// Submit code with two tescase example.
$response = HackerRank::checker()->submission('php', '
function solveMeFirst($a,$b){
return $a+$b;
}
$handle = fopen ("php://stdin","r");
$_a = fgets($handle);
$_b = fgets($handle);
$sum = solveMeFirst((int)$_a,(int)$_b);
print ($sum);
fclose($handle);