EN VI
Posts (0)
Questions (8)
2024-03-10 21:00:08
You could apply this logic with a single pass through the input values, while creating the result vector: If the current value is a 1, and also the previous value was a 1, then increment the last val...
Tags: arrays algorithm c++11
2024-03-12 06:30:07
The algo is the following: Spread item indices by size Make equal chunks of indices of the required group count Compare edges of the chunks and cut smaller index count on edges of siblings chunks Pro...
Tags: Javascript algorithm math
2024-03-12 19:30:06
You've said: It should go down to zero (unlike my first diagram), so there are 8 slots every repeat. So that means the diagram should be: | | | | ||| ||| |||...
Tags: algorithm
2024-03-16 01:30:11
return if n (amount of) new flowers can be planted in the flowerbed without violating the no-adjacent-flowers rule. so its not n HAS to be Max amount possible to be planted. its if N is less than or e...
Tags: algorithm
2024-03-16 03:30:06
Question 1: I'm wondering if my time complexities are written correctly. Thoughts ? In the tree representation, nothing prevents you from storing pointers to the min and max elements, so it can be O...
2024-03-16 13:30:04
Hash functions used for hash tables are typically much, much simpler than sha256 or keckak256. For strings, for example, Java uses a simple 32-bit polynomial hash. The calculation is documented her...
2024-03-17 02:30:05
O(n + m * sqrt(k)), where: n is the length of arr2; m is the length of arr1; k is the maximum number in arr1. sqrt(k) is the same as k**(1/2), so it's sublinear and therefore cannot be simplified to...
2024-03-17 07:30:04
You forgot to init this.nextRefillTime = -Infinity; this.numberOfTokenAvailable = 0; class TokenBucket { constructor(maxBucketSize, numberOfRequests, windowSizeForRateLimitInMilliseconds...

Login


Forgot Your Password?

Create Account


Lost your password? Please enter your email address. You will receive a link to create a new password.

Reset Password

Back to login