Skip to content

Instantly share code, notes, and snippets.

epzee

Block or report user

Report or block epzee

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@epzee
epzee / flatten.js
Last active Nov 14, 2017
citrusbyte - flatten // tested on https://repl.it/languages/jest
View flatten.js
const reducer = (result, item) => {
const flattened = Array.isArray(item) ? flatten(item) : item;
return result.concat(flattened);
}
const flatten = (array) => array.reduce(reducer, []);
module.exports = flatten;
View stickermule-test-03.js
// Add your javascript here
const endpoint = 'https://jsonmock.hackerrank.com/api/movies/search/';
const input = document.getElementById('q');
const form = document.getElementById('search_form');
const list = document.getElementById('results');
form.addEventListener('submit', async (e) => {
e.preventDefault();
View stickermule-test-02.js
function maxDifference(a) {
let maxDiff = -1;
let min = a[0];
for (let i = 1; i < a.length; i++) {
if (a[i] - min > maxDiff) {
// update diff if greater diff was found
maxDiff = a[i] - min;
}
View stickermule-test-01.js
function doubleSize(a, b) {
let max = b;
a.sort().forEach(item => {
if (item === max) {
max = max * 2;
}
})
return max;
View jigsaw syntax
$one->up();
$one->down();
$one->right();
$one->left();
You can’t perform that action at this time.