Skip to content

shashankKeshava/jsfoo-equal-experts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Equal Experts Coding Challenge at JSFoo 2018

Complete the following coding challenge and got free swag

  1. Non-unique Elements You are given a non-empty list of integers (X). For this task, you should return a list consisting of only the non-unique elements in this list. To do so you will need to remove all unique elements (elements which are contained in a given list only once). When solving this task, do not change the order of the list. Example: [1, 2, 3, 1, 3] 1 and 3 non-unique elements and result will be [1, 3, 1, 3].

    Example: nonUniqueElements([1, 2, 3, 1, 3]) == [1, 3, 1, 3]

    Source: nonUnique.js

  2. Median A median is a numerical value separating the upper half of a sorted array of numbers from the lower half. In a list where there are an odd number of entities, the median is the number found in the middle of the array. If the array contains an even number of entities, then there is no single middle value, instead the median becomes the average of the two numbers found in the middle. For this mission, you are given a non-empty array of natural numbers (X). With it, you must separate the upper half of the numbers from the lower half and find the median.

    Example: median([1, 2, 3, 4, 5]) == 3

    Source: median.js

  3. Moore Neighbourhood You are given a state for a rectangular board game grid with chips in a binary matrix, where 1 is a cell with a chip and 0 is an empty cell. You are also given the coordinates for a cell in the form of row and column numbers (starting from 0). You should determine how many chips are close to this cell. Every cell interacts with its eight neighbours; those cells that are horizontally, vertically, or diagonally adjacent.

    Example: countNeighbours([[1, 0, 0, 1, 0], [0, 1, 0, 0, 0], [0, 0, 1, 0, 1], [1, 0, 0, 0, 0], [0, 0, 1, 0, 0]], 1, 2) == 3

    Source: mooreNeighbour.js

Free Swag

Image of Free Goodies from Equal Experts

About

Equal Experts Coding Challenge at JSFoo 2018

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors