This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Complete the 'equalizeArray' function below. | |
* | |
* The function is expected to return an INTEGER. | |
* The function accepts INTEGER_ARRAY arr as parameter. | |
*/ | |
function equalizeArray(arr) { | |
// Write your code here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Complete the 'squares' function below. | |
* | |
* The function is expected to return an INTEGER. | |
* The function accepts following parameters: | |
* 1. INTEGER a | |
* 2. INTEGER b | |
*/ | |
function isInt(num) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Complete the 'saveThePrisoner' function below. | |
* | |
* The function is expected to return an INTEGER. | |
* The function accepts following parameters: | |
* 1. INTEGER n | |
* 2. INTEGER m | |
* 3. INTEGER s | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function processData(input) { | |
//Enter your code here | |
const map = new Map() | |
input = input.split("\n") | |
const lines = input[0] | |
for (let i = 1; i <= lines; i++) { | |
const name = input[i].split(" ")[0] | |
const phone = input[i].split(" ")[1] | |
map.set(name, phone) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Complete the 'beautifulDays' function below. | |
* | |
* The function is expected to return an INTEGER. | |
* The function accepts following parameters: | |
* 1. INTEGER i | |
* 2. INTEGER j | |
* 3. INTEGER k | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Complete the 'angryProfessor' function below. | |
* | |
* The function is expected to return a STRING. | |
* The function accepts following parameters: | |
* 1. INTEGER k | |
* 2. INTEGER_ARRAY a | |
*/ | |
function angryProfessor(k, a) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Complete the 'utopianTree' function below. | |
* | |
* The function is expected to return an INTEGER. | |
* The function accepts INTEGER n as parameter. | |
*/ | |
function utopianTree(n) { | |
// Write your code here | |
let height = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Complete the 'designerPdfViewer' function below. | |
* | |
* The function is expected to return an INTEGER. | |
* The function accepts following parameters: | |
* 1. INTEGER_ARRAY h | |
* 2. STRING word | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Complete the 'birthday' function below. | |
* | |
* The function is expected to return an INTEGER. | |
* The function accepts following parameters: | |
* 1. INTEGER_ARRAY s | |
* 2. INTEGER d | |
* 3. INTEGER m | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Complete the 'getTotalX' function below. | |
* | |
* The function is expected to return an INTEGER. | |
* The function accepts following parameters: | |
* 1. INTEGER_ARRAY a | |
* 2. INTEGER_ARRAY b | |
*/ | |
function getTotalX(a, b) { |
NewerOlder