Yaduttam PareekforThe Dev Denyoichiisagi.hashnode.net路Feb 26, 2023Problem Solving: Google's Coding Interview Problem: Counting InversionsHI! 馃憢 In this post, we will solve a coding interview problem asked by Google. Problem Statement The problem is to count the number of inversions in an array, i.e., the number of pairs (i, j) such that i < j and A[i] > A[j]. Example: Input: {2, 4, 1,...Discuss路11 likescoding
Yaduttam PareekforThe Dev Denyoichiisagi.hashnode.net路Feb 25, 2023Problem Solving: Amazon's Coding Interview Problem: Stack with max value retrievalHI! 馃憢 In this post, we will solve a coding interview problem asked by Amazon. A stack is a fundamental data structure used in computer science and programming. It is a collection of elements that follow a "last in, first out" (LIFO) order. In other ...Discuss路10 likesthedevden
Yaduttam PareekforThe Dev Denyoichiisagi.hashnode.net路Feb 27, 2023Problem Solving: Two Sigma's Coding Interview Problem: Rand7 using Rand5HI! 馃憢 In this post, we will solve a coding interview problem asked by Two Sigma. In this coding interview problem, we are given a function rand5() that returns an integer between 1 and 5 (inclusive) with uniform probability. Our task is to implement...Discuss路10 likes路40 readscoding
Yaduttam PareekforThe Dev Denyoichiisagi.hashnode.net路Mar 7, 2023Minimum Time to Complete Trips: Solving the LeetCode Challenge - March 7, 2023Problem Statement Given an array time where time[i] denotes the time taken by the ith bus to complete one trip. Each bus can make multiple trips successively, and each bus operates independently. You are also given an integer totalTrips, which denote...Discussthedevden
Yaduttam PareekforThe Dev Denyoichiisagi.hashnode.net路Mar 5, 2023Jump Game IV: Solving the LeetCode Challenge - March 5, 2023Problem Statement Given an array of integers arr, you are initially positioned at the first index of the array. In one step, you can jump from index i to index: i + 1 where: i + 1 < arr.length. i - 1 where: i - 1 >= 0. j where: arr[i] == arr[j] an...Discuss路10 likes路46 readsthedevden
Yaduttam PareekforThe Dev Denyoichiisagi.hashnode.net路Mar 4, 2023Count Subarrays With Fixed Bounds: Solving the LeetCode Challenge - March 4, 2023Problem Statement: Given an integer array nums and two integers minK and maxK, we need to find the number of fixed-bound subarrays. A fixed-bound subarray of nums is a subarray that satisfies the following conditions: The minimum value in the subarr...Discuss路38 readsthedevden
Yaduttam PareekforThe Dev Denyoichiisagi.hashnode.net路Mar 3, 2023Find the Index of the First Occurrence in a String: Solving the LeetCode Challenge - March 3, 2023In this blog post, we will discuss the problem statement and provide a Java solution to implement strStr() function using the sliding window approach. Problem Statement The problem statement is simple - given two strings haystack and needle, we need ...Discuss路37 readsthedevden
Yaduttam PareekforThe Dev Denyoichiisagi.hashnode.net路Mar 2, 2023Efficiently Compressing Strings: Solving the LeetCode Challenge - March 2, 2023Given an array of characters chars, compress it using the following algorithm: Begin with an empty string s. For each group of consecutive repeating characters in chars: If the group's length is 1, append the character to s. Otherwise, append the c...Discuss路49 readsleetcode
Yaduttam PareekforThe Dev Denyoichiisagi.hashnode.net路Mar 1, 2023Problem Solving: Facebook's Coding Interview Problem: Stock Buy Sell to Maximize ProfitHI! 馃憢 In this post, we will solve a coding interview problem asked by Facebook. If you've ever invested in the stock market, you know that timing is everything. Knowing when to buy and sell can make the difference between making a profit and losing ...Discussthedevden
Yaduttam PareekforThe Dev Denyoichiisagi.hashnode.net路Feb 28, 2023Problem Solving: Amazon's Coding Interview Problem: Longest Palindromic SubstringHI! 馃憢 In this post, we will solve a coding interview problem asked by Amazon. The problem is to find the longest palindromic contiguous substring in a given string. We will discuss the brute-force approach to solve this problem, which has a time com...Discuss路30 readsthedevden
Yaduttam PareekforThe Dev Denyoichiisagi.hashnode.net路Feb 27, 2023Problem Solving: Two Sigma's Coding Interview Problem: Rand7 using Rand5HI! 馃憢 In this post, we will solve a coding interview problem asked by Two Sigma. In this coding interview problem, we are given a function rand5() that returns an integer between 1 and 5 (inclusive) with uniform probability. Our task is to implement...Discuss路10 likes路40 readscoding
Yaduttam PareekforThe Dev Denyoichiisagi.hashnode.net路Feb 26, 2023Problem Solving: Google's Coding Interview Problem: Counting InversionsHI! 馃憢 In this post, we will solve a coding interview problem asked by Google. Problem Statement The problem is to count the number of inversions in an array, i.e., the number of pairs (i, j) such that i < j and A[i] > A[j]. Example: Input: {2, 4, 1,...Discuss路11 likescoding
Yaduttam PareekforThe Dev Denyoichiisagi.hashnode.net路Feb 25, 2023Problem Solving: Amazon's Coding Interview Problem: Stack with max value retrievalHI! 馃憢 In this post, we will solve a coding interview problem asked by Amazon. A stack is a fundamental data structure used in computer science and programming. It is a collection of elements that follow a "last in, first out" (LIFO) order. In other ...Discuss路10 likesthedevden