Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
5 votes
2 answers
836 views

Simplify complexity [closed]

I came across this question which asks to create a function which will return true/false based on the passed array containing all the letters to make up the passed word. Each letter from array can ...
user282070's user avatar
3 votes
1 answer
141 views

Handwriting progressive drawing

Implementation to progressively draw symbols, when provided with symbol implementations it supports any type of symbols, though for the review purpose just two hand written latin symbols are supported ...
user avatar
1 vote
2 answers
1k views

Leetcode 55. Jump Game solution

I was working on Jump Game problem on leetcode Question You are given an integer array nums. You are initially positioned at the array's first index, and each element in the array represents your ...
D_S_X's user avatar
  • 189
1 vote
2 answers
428 views

group countries by language in JavaScript

I need a better implementation than the below code (O(N) Solution), I am grouping countries by language ( data ) is the countries JSON, each country could have 0, 1 .. or more language as the object ...
Odeh Abuzaid's user avatar
-2 votes
2 answers
135 views

Getting items that have more than one entry in the array with optimized code

...
PDHide's user avatar
  • 123
3 votes
4 answers
216 views

Is this an efficient/correct way to get largest Prime factor?

Is this an efficient way to get the largest prime factor of a given number? Other solutions I found involved nested algorithms. ...
Tharindu's user avatar
  • 143
4 votes
2 answers
5k views

Merge arrays in objects in array based on property

I have the following code which takes an array that might have duplicate ids and will merge the items of those duplicate, and ...
callback's user avatar
  • 199
4 votes
1 answer
732 views

Performant Sort function for big arrays

In sort(arr), I want to sort an array. Children must be beneath their parent. And children of the same parent are sorted using ...
Helix112's user avatar
  • 143
3 votes
2 answers
147 views

Cyclomatic Complexity (complexity)

I have a program for finding shortest distance/path and I got a correct answer but I am getting an issue i.e., "Function 'shortestPath' has a complexity of 9. Maximum allowed is 6." This is ...
L.Nyamagoud's user avatar
3 votes
1 answer
98 views

Count number of square integers in a given range of ints (faster function?)

The function below passes most test cases: ...
kennsorr's user avatar
  • 213
2 votes
1 answer
408 views

Car Pooling algorithm time complexity

I created a solution for the car pooling algorithm. Problem: You are driving a vehicle that has capacity empty seats initially available for passengers. The vehicle only drives east (ie. it cannot ...
myTest532 myTest532's user avatar
3 votes
0 answers
138 views

Benchmarking multiple implementations of a Code Kata: queue for the self-checkout tills at the supermarket

I was reading this question: Why is my function timing out when run with a larger data set? And although I couldn't quite grasp the OP's implementation and so didn't feel like answering. I did some ...
slepic's user avatar
  • 5,627
3 votes
1 answer
115 views

Finding Common Items in arrays

My goal is to get a list of related statementIds in order of most repeated. In my database I have stems(Words): ...
user12904402's user avatar
2 votes
1 answer
106 views

Circular Doubly Linked List with generators

I didn't find an implementation on CR of the circular doubly linked list, using generators. Hence, I tried it myself. Description The class Deck represents a ...
dfhwze's user avatar
  • 14.1k
-2 votes
1 answer
197 views

Challenge - Construct binary tree from array [closed]

A coding challenge to construct a binary tree from an array. ...
Drewsup123's user avatar

15 30 50 per page