Skip to content

Instantly share code, notes, and snippets.

View akinjide's full-sized avatar

Akinjide Bankole akinjide

View GitHub Profile
/**
Write a function that takes three arguments, 2 arrays (a and b) and 1 integer (c)
then returns one array (d) which is created by inserting all elements in b into a at indexes
which are spaced by the integer value.
Consider all possible corner cases and print out the final array (d).
e.g
a = ["a", "b", "c", "d", "e", "f"]
b = ["1", "2", "3"]
c = 2
/**
Find the longest substring in string. Output the length of the substring
e.g
s = 'ababc'
sub = 3
*/
const s = 'ababc';