Skip to content

Instantly share code, notes, and snippets.

View Habil99's full-sized avatar
🏠
Working from home

Habil Abiyev Habil99

🏠
Working from home
View GitHub Profile
@Habil99
Habil99 / equalize-array.js
Created May 9, 2022 12:46
Equalize the array Hackerrank best solution in js
/*
* 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
@Habil99
Habil99 / sherlock-and-squares.js
Created May 9, 2022 12:30
Sherlock and Squares the best solution in js
/*
* 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) {
@Habil99
Habil99 / save-prisioner.js
Created April 12, 2022 10:23
Save the prisioner solution in javascript
/*
* 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
*/
@Habil99
Habil99 / dictionaries-and-map.js
Created April 8, 2022 10:04
Dictionaries and Map (30days of Code)
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)
@Habil99
Habil99 / beautiful-days-at-the-movies.js
Last active April 5, 2022 11:34
Beautiful Days at the Movies solution in Javascript
/*
* 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
*/
@Habil99
Habil99 / angry-professor.js
Created April 5, 2022 10:27
Angry Professor solution in javascript
/*
* 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) {
@Habil99
Habil99 / utopian-tree.js
Created April 5, 2022 10:17
Utopian Tree solution in javascript
/*
* 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;
@Habil99
Habil99 / designer-pdv-viewer.js
Created April 5, 2022 09:59
Designer PDF Viewer solution in javascript
/*
* 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
*/
@Habil99
Habil99 / subarray-divission.js
Created April 4, 2022 05:40
Subarray Divission Solution in Javascript
/*
* 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
*/
@Habil99
Habil99 / between-two-sets.js
Last active April 3, 2022 17:25
Between two sets solution in Javascript
/*
* 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) {