All Questions
6 questions
-2
votes
1
answer
189
views
Challenge - Construct binary tree from array [closed]
A coding challenge to construct a binary tree from an array.
...
2
votes
0
answers
51
views
Find target in sorted array pivoted at some unknown point in O(log n)
You are given an array sorted in ascending order which is rotated at
some pivot unknown to you beforehand. Find your target in \$O(log n)\$
which means it should be a binary search. If the value ...
1
vote
1
answer
135
views
Possible letter combinations of a dial pad in linear time using a recursive approach
Time complexity: I walk the initial unzipped array of keys representing the number O(N) backwards. I then do an inner walk of the proceeding array of letters *O(L^2), mapping it to every value in the ...
2
votes
2
answers
2k
views
Determine if Array has an Increasing Sequence
I wrote a function in JavaScript that expects an array of integers (negative or positive) and determines if that array has an increasing sequence.
For the sake of better time performance I made the ...
5
votes
2
answers
724
views
Finding substrings within arrays
I need to find the substrings within my array. If I have an array: ["abc", "abcd", "abcde", "xyz"], my method should return the array members: ...
4
votes
3
answers
2k
views
Removing duplicates from an array
I recently wrote this JavaScript algorithm for removing duplicates from an array as part of a job interview process, but was turned down for the position after submitting the code. I didn't receive ...