HackerRank – Dynamic Array Solution in JavaScript – O(n) Time

hackerrank dynamic array in javascript

Dynamic Array is a coding challenge with easy difficulty in the HackerRank data structures category. In this blog post, we’ll discuss how we can solve it in JavaScript in O(n) time and O(n) space complexity. Problem Statement Personal Note : The original problem statement is quite confusing as it is not clear on what we … Read more

HackerRank – Cycle Detection Solution in JavaScript – O(1) Space

hackerrank cycle detection in javascript

Cycle Detection is a coding challenge with medium difficulty in the HackerRank data structures category. In this blog post, we’ll discuss how we can solve it in JavaScript in O(n) time and O(1) space complexity. Problem Statement A linked list is said to contain a cycle if any node is visited more than once while traversing the … Read more

HackerRank – Sparse Arrays Solution in JavaScript – O(n) Time

hackerrank sparse arrays in javascript

Sparse Arrays is a coding challenge with medium difficulty in the HackerRank data structures category. In this blog post, we’ll discuss how we can solve it in JavaScript in O(n) time. Problem Statement There is a collection of input strings and a collection of query strings. For each query string, determine how many times it … Read more