#+auto-tangle: t
See the ready Deployed project on [ Github Pages](https://hacking-nassa-with-html.github.io/Alejandro_Vyacheslav_Microverse_Trial_cool_project/).
Link to problem in HackerRank Solution:
// This file was generated by README.org, read the solution from the source to get the link to the problem
function minimumDistances(a) {
// Write your code here
const minDistances = [];
for (let i = 0; i < a.length; i++) {
for (let j = i+1; j < a.length; j++) {
if (a[i] === a[j]) {
minDistances.push(Math.abs(i-j));
}
}
};
return minDistances.length > 0 ? Math.min(...minDistances): -1;
}
Link to problem in HackerRank Solution:
// This file was generated by README.org, read the solution from the source to get the link to the problem
function hurdleRace(k, height) {
// Write your code here
let maximum = height.reduce((max, element) => {
if(element > max) return element;
return max;
});
let numPotions = (maximum > k) ? (maximum - k) : 0;
return numPotions;
}