Hi Geeks! Welcome to 100 Days of Leetcode Challenge. Day 5 Today we going to see about implementation of sqrt(x). Let's jump into our given question, Implement int sqrt(int x). Compute and return the square root of x, where x is guaranteed to be a non-negative integer. Since the return type is an integer, the decimal digits are truncated and only …

# Month: February 2020

# Evaluate Reverse Polish Notation

Hi Geeks! Welcome to 100 Days of Leetcode Challenge. Day 4 Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /. Each operand may be an integer or another expression. Note: Division between two integers should truncate toward zero.The given RPN expression is always valid. That means the expression would always evaluate …

# Finding all Subsets of a given set

Hi Geeks! Welcome to 100 Days Leetcode Challenge. Day 3 In this article, I'll explain about how to find all the subsets of a given set(power set). Here is our given problem, Given a set of distinct integers, nums, return all possible subsets. Note: The solution set must not contain duplicate subsets. Example: Input: nums = [1,2,3] Output: [ [3], …

# Product of Array Except Self

Hi Geeks! Welcome to 100 Days Leetcode Challenge. Day 2 Here is our given problem, Given an array nums of n integers where n > 1, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i]. Example: Input: [1,2,3,4] Output: [24,12,8,6] Note: Please solve it without division and in O(n). Follow up:Could you solve it with constant space complexity? (The output array does …

# Top K Frequent Elements

Hi Geeks! Welcome to 100 Days Leetcode Challenge. Day 1 Here is our given problem, Given a non-empty array of integers, return the k most frequent elements. Example 1: Input: nums = [1,1,1,2,2,3], k = 2 Output: [1,2] Example 2: Input: nums = [1], k = 1 Output: [1] Note: You may assume k is always valid, 1 ≤ k ≤ …

# 100 Days Leetcode Challenge

Hi Geeks! Welcome to 100 Days Leetcode challenge. In these days, we going to solve Leetcode's top 100 data structures and algorithm problems. Purpose of 100 Days Leetcode Challenge The main purpose of this challenge is, as a Software Developer we should have a strong command over the algorithms and data structures.Solving these problems daily, …

# jQuery prepend() with Example

In this tutorial, I will explain about .prepend() method in jQuery. jQuery prepend() method is used to insert the specified content at the beginning of the selected element. It is an inbuilt method in jQuery. If we want to insert our content at the end of the selected elements, then we want to use jQuery …

# Reverse an Integer Digits

In this article, we going to see about How to Reverse an Integer? Given a 32-bit signed integer, reverse digits of an integer. Example 1: Input: 123 Output: 321 Example 2: Input: -123 Output: -321 Example 3: Input: 120 Output: 21 Note:Assume we are dealing with an environment which could only store integers within the …

# Type Coercion in JavaScript – Well Explained

Hi Geeks! In this article, we going to see about Type Coercion in JavaScript. Most of the people who familiar with JavaScript still have doubt in this topic. Initially, type coercion in JavaScript looks confusing. But when we approach this by using simple examples, it becomes easier to understand. Before going to the examples, let's …

Continue reading Type Coercion in JavaScript – Well Explained