Search This Blog
removing stars from a string leetcode solution
removeStars This post is about how to remove stars from a string leetcode javascript solution. For problem statement click here . This is very easy solution remove stars from string in javascrip…
Read morenext greater element I leetcode solution
Javascript program of next greater element I leetcode solution Approach 1 (Brute Force): var nextGreaterElement = function (nums1, nums2) { let hash = {}, result = [], index, j; …
Read moremoving average from data stream leetcode solution
Javascript program moving average from data stream leetcode solution var MovingAverage = function (size) { this .size = size; this .slidingWindow = []; this .sum = 0…
Read morenumber of recent calls leetcode solution
Javascript program of number of recent calls leetcode solution var RecentCounter = function () { this .slideWindow = []; }; RecentCounter.prototype.ping = function (t) { this …
Read moremake the string great leetcode solution
Javascript program to make the string great leetcode solution var isBadCasing = function (c, s) { return Math.abs(c.charCodeAt() - s.charCodeAt()) === 32 ; } var makeGood = function (…
Read moresimply path leetcode solution
/** * @param {string} path * @return {string} */ Javascript program to simplify path javascript leetcode solution var simplifyPath = function (path) { let p = path.split( &quo…
Read moreeasy solution palindrome linked list
This solution beats 98% time complexity and 97% space complexity in javascript leetcode solution. What we are doing in this solution, we are finding middle node in linked list. After that we rev…
Read more