• React apps: Simple Counter using React

    React hooks are something that are fascinating me to try and use them. Will go in deep from starting, but sticking to today’s topic: Simple counter using React. Let’s dive in: For a simple counter we need to use useState. How to use? We used a count variable that will contain the count. setCounter will…

  • How to download restricted videos from Google Drive?

    If someone shares video/image/doc/pdf on google drive. If you want to share a restricted video, it won’t be available for the other users who do not have the access. Steps -: Right click on window, and click on ‘inspect elements’. Select Network tab. Check for the videoplayback option. Now check the url of this option.…

  • Whatsapp new privacy policy??

    Last week Whatsapp rolled out a privacy banner that will share all of their data with Facebook. This pop-up message to users is delivered in some regions, including India, asking them to accept the new privacy regulations or they will risk losing their accounts. It is mandatory for the whatsapp users to accept these terms and…

  • Merge Two Sorted Lists #21 Leetcode Problem #Leetcodeseries

    Problem name: Merge Two Sorted Lists Problem statement: Merge two sorted linked lists and return it as a sorted list. The list should be made by splicing together the nodes of the first two lists. Example 1: Input: l1 = [1,2,4], l2 = [1,3,4] Output: [1,1,2,3,4,4] Example 2: Input: l1 = [], l2 = [] Output: []…

  • Best Time to Buy and Sell Stock II #122 Leetcode Problem #Leetcodeseries

    Problem name: Best Time to Buy and Sell Stock II Problem statement: Say you have an array prices for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may complete as many transactions as you like (i.e., buy one and sell one share of the stock…

  • Symmetric Tree #101 Leetcode Problem #Leetcodeseries

    Problem name: Symmetric trees Problem statement: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4,4,3] is symmetric: 1 / \ 2 2 / \ / \ 3 4 4 3 But the following [1,2,2,null,3,null,3] is not: 1 / \ 2 2 \ \ 3 3…

  • Decode ways #91 Leetcode Problem #Leetcodeseries

    Problem name: Decode ways Problem statement: A message containing letters from A-Z can be encoded into numbers using the following mapping: ‘A’ -> “1” ‘B’ -> “2” … ‘Z’ -> “26” To decode an encoded message, all the digits must be mapped back into letters using the reverse of the mapping above (there may be multiple ways). For example, “111” can have each…

  • Maximum Subarray #53 Leetcode Problem #Leetcodeseries

    Problem name: Maximum subarray Problem statement: Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. Follow up: If you have figured out the O(n) solution, try coding another solution using the divide and conquer approach, which is more subtle. Example 1: Input: nums = [-2,1,-3,4,-1,2,1,-5,4] Output: 6 Explanation: [4,-1,2,1]…

  • Container With Most Water #11 Leetcode Problem #Leetcodeseries

    Problem name: Container With Most Water Problem statement: Given n non-negative integers a1, a2, …, an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of the line i is at (i, ai) and (i, 0). Find two lines, which, together with the x-axis forms a container, such that the container contains the most water. Notice that…

  • Two Sum #1 Leetcode Problem #Leetcodeseries

    Problem name: Two Sum Problem statement: Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not use the same element twice. You can return the answer in any order. Example 1: Input: nums = [2,7,11,15], target…