Promises in JavaScript: Def, Creation, Call, Pros and Cons, Behind-the-Scenes Work, Real world Example

Definition Promises in JavaScript Promises state Prmises Method Resolve & reject Real World Example of Promises Question Related to About topic

In the dynamic realm of JavaScript, promises stand as a pivotal concept, transforming the landscape of asynchronous programming. This comprehensive guide will navigate you through the intricacies of promises, covering everything from their definition and creation to the call stack and beyond. Understanding Promises in JavaScript Defining Promises At its core, a promise is an … Read more

Global and Local Variables in Javascript

creation of the execution context

Hello, It is our 2nd day of learning Javascript, if you come directly here please check out how the javascript is executing in the backend, how the call stack is created how the Execution context is created, and the flow of execution. in the simple word if you created the function and assigned the variable ( eg. var n=10) inside … Read more

Leetcode 342. Power of Four (Easy)

Leetcode 342. Power of Four

LeetCode 342. Power of Four :Hey there, coding enthusiasts! Welcome back to another exciting coding session. Today’s problem is a treat—literally! We’re going to solve the “Power of Four” or “LeetCode 342. Method we are using are Mathematical approach and Bit Manipulation. Approach : Mathematical Line Explanation n x fmod(x, 1.0) Output 1 Check if n <= 0. 16 – … Read more

LeetCode 1793. Maximum Score of a Good Subarray (Hard)

LeetCode 1793. Maximum Score of a Good Subarray

LeetCode 1793. Maximum Score of a Good Subarray :Hey there, coding enthusiasts! Welcome back to another exciting coding session. Today’s problem is a treat—literally! We’re going to solve the “Maximum Score of a Good Subarray” or “LeetCode 1793. ‘ Appraoch : Two Pointer dry run of the given code with the example ‘A = [1,4,3,7,4,5]’ and ‘k = … Read more

LeetCode1425. Constrained Subsequence Sum (Medium) – DP + Heap Appraoch

1425. Constrained Subsequence Sum

LeetCode 1425. Constrained Subsequence Sum :Hey there, coding enthusiasts! Welcome back to another exciting coding session. Today’s problem is a treat—literally! We’re going to solve the “Constrained Subsequence Sum” or “LeetCode 1425. ‘ Approach: Dynamic Programming with a Heap table representing the step-by-step calculation of the example with the input array nums = [10, 2, -10, 5, 20] … Read more

Leetcode 1361. Validate Binary Tree Nodes (Medium)

1361. Validate Binary Tree Nodes

In the world of competitive programming, Leetcode stands as a ubiquitous platform where aspiring developers and programmers sharpen their skills. It offers a wide array of problems that challenge your ability to think critically and come up with innovative solutions. One such problem is Leetcode 1361 – “Validate Binary Tree Nodes.” This problem not only … Read more

Leetcode 2742. Painting the Walls

Leetcode 2742. Painting the Walls

Leetcode 2742. – Painting the Walls:Welcome to the world of dynamic programming, where we tackle complex problems with elegant solutions. Today, we’re diving into the intriguing challenge of Leetcode 2742. – Painting the Walls. This problem, while seemingly simple, can be quite tricky to solve efficiently. We’ll guide you through the process step by step, … Read more

leetcode 1095. Find in Mountain Array (hard)

1095. Find in Mountain Array

Welcome, fellow coding enthusiasts! Today, we’re going to embark on an exciting journey into the world of Leetcode and explore the fascinating problem of “leetcode 1095.” or “Find in Mountain Array.” In this blog post, we’ll break down this problem, guide you through the concept of Mountain Arrays, and provide a solution to tackle it. … Read more

Leetcode 53. Maximum Subarray (Medium)

LeetCode 53. Maximum Subarray

LeetCode 53. Maximum Subarray :Hey there, coding enthusiasts! Welcome back to another exciting coding session. Today’s problem is a treat—literally! We’re going to solve the “Maximum Subarray” or “LeetCode 53. ‘ There are various approach to solve “Maximum Subarray” problem . we discuss three main approach which are optimaized – Kedane algo , Dp , Divide and conquer … Read more

LeetCode 1420: Build Array Where You Can Find The Maximum Exactly K Comparisons

LeetCode 1420 Build Array Where You Can Find The Maximum Exactly K Comparisons

LeetCode 1420. Build Array Where You Can Find The Maximum Exactly K Comparisons :Hey there, coding enthusiasts! Welcome back to another exciting coding session. Today’s problem is a treat—literally! We’re going to solve the “Build Array Where You Can Find The Maximum Exactly K Comparisons” or “LeetCode 1420 ‘  Understanding the Challenge Before we delve into the … Read more

LeetCode 343. Integer Break (Medium)

LeetCode 343. Integer Break (Medium)

Welcome, dear readers! Today, we’re diving deep into the world of integer breaks and taking on the intriguing challenge posed by LeetCode 343 Integer Break. If you’re new to coding or a seasoned programmer looking to enhance your problem-solving skills, you’re in the right place. 🤔? So, what’s the deal with “Integer Break,” and why … Read more

LeetCode 229. Majority Element II (Medium)

229. Majority Element II

Leetcode 229. Majority Element II:Hey there, coding enthusiasts! Welcome back to another exciting coding session. Today’s problem is a treat—literally! We’re going to solve the “Majority Element II” or “LeetCode 229. ‘  Method : HashMap Approach – Majority Element II 1: Initialize Data Structures 2: Count Element Occurrences 3: Calculate the Threshold 4: Iterate Over Counts 5: … Read more

Leetcode 706. Design HashMap (Easy)

Leetcode 706. Design HashMap (Easy)

Leetcode 706. Design HashMap:Hey there, coding enthusiasts! Welcome back to another exciting coding session. Today’s problem is a treat—literally! We’re going to solve the “Design HashMap” or “LeetCode 706. ‘  Codes : Leet code 706. C++:Leetcode 706. Java: Leetcode 706. Python: Leet code 706. Leetcode 1359 Count All Valid Pickup and Delivery Options (HARD) JavaScript: Leet code … Read more

Leetcode 1512. Number of Good Pairs (easy)

Leetcode 1512. Number of Good Pairs

Leetcode 1512Number of Good Pairs:Hey there, coding enthusiasts! Welcome back to another exciting coding session. Today’s problem is a treat—literally! We’re going to solve the “Number of Good Pairs” or “LeetCode .1512‘  First Approach : bruteforce (Looping) -Number of Good Pairs The Bruteforce is simplest approach ,we used .The Looping approach contain two loops and … Read more

Leetcode 2038. Remove Colored Pieces if Both Neighbors are the Same Color

Leetcode 2038. Remove Colored Pieces if Both Neighbors are the Same Color

Leetcode 2038. Remove Colored Pieces if Both Neighbors are the Same Color:Hey there, coding enthusiasts! Welcome back to another exciting coding session. Today’s problem is a treat—literally! We’re going to solve the “Remove Colored Pieces if Both Neighbors are the Same Color ” or “LeetCode .2038‘ Greedy Appraoch : Leetcode 2038. Remove Colored Pieces if Both Neighbors … Read more