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 … Continue reading Product of Array Except Self

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 ≤ … Continue reading Top K Frequent Elements

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, … Continue reading 100 Days Leetcode Challenge

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 … Continue reading jQuery prepend() with Example

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 … Continue reading Reverse an Integer Digits

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