vafadie kongolovamerlen.hashnode.dev·Jun 1, 2024Learn Data Structures and Algorithms with PythonUnderstanding data structures and algorithms is crucial for aspiring developers, particularly those preparing for technical interviews. This blog series aims to equip beginners and intermediate programmers with the knowledge and skills needed to exce...20 likesGeneral Programming
GAURAV YADAVgaurav246blogs.hashnode.dev·Jan 8, 2024151 DSA Problem journeyQ20:Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum to target. You may return the combinations in any order. The same number may be chosen...19 likesC++
GAURAV YADAVgaurav246blogs.hashnode.dev·Jan 1, 2024151 DSA Problem journeyQ19:The set [1, 2, 3, ..., n] contains a total of n! unique permutations. By listing and labeling all of the permutations in order, we get the following sequence for n = 3: "123" "132" "213" "231" "312" "321" Given n and k, return the k<sup>t...20 likesC++
GAURAV YADAVgaurav246blogs.hashnode.dev·Dec 27, 2023151 DSA Problem journeyQ18:Given an array nums of distinct integers, return all the possible permutations. You can return the answer in any order. Example : Input: nums = [1,2,3] Output: [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]] Solution: class Solution { public: v...13 likesC++
GAURAV YADAVgaurav246blogs.hashnode.dev·Dec 26, 2023151 DSA Problem journeyQ17:Given an array Arr[] of size L and a number N, you need to write a program to find if there exists a pair of elements in the array whose difference is N. Example : Input: L = 6, N = 78 arr[] = {5, 20, 3, 2, 5, 80} Output: 1 Explanation: (2, 80) h...17 likesC++
GAURAV YADAVgaurav246blogs.hashnode.dev·Dec 25, 2023151 DSA Problem JourneyQ16:Given an array Arr of N positive integers and another number X. Determine whether or not there exist two elements in Arr whose sum is exactly X. Example : Input: N = 6, X = 16 Arr[] = {1, 4, 45, 6, 10, 8} Output: Yes Explanation: Arr[3] + Arr[4] ...14 likesC++
GAURAV YADAVgaurav246blogs.hashnode.dev·Dec 24, 2023151 DSA Problem journeyQ15:You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the i<sup>th</sup> line are (i, 0) and (i, height[i]). Find two lines that together with the x-axis form a container, such that the...18 likesC++
GAURAV YADAVgaurav246blogs.hashnode.dev·Dec 23, 2023151 DSA Problem journeyQ14:Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining. Example : Input: height = [0,1,0,2,1,0,1,3,2,1,2,1] Output: 6 Explanation: The above elevation map (b...18 likesC++
GAURAV YADAVgaurav246blogs.hashnode.dev·Dec 18, 2023151 DSA Problem journeyQ13:Assume you have an array of length n initialized with all 0's and are given k update operations. Each operation is represented as a triplet: [startIndex, endIndex, inc] which increments each element of subarray A[startIndex ... endIndex] (startIn...20 likesC++
GAURAV YADAVgaurav246blogs.hashnode.dev·Dec 16, 2023151 DSA Problem journeyQ12:Given arrival and departure times of all trains that reach a railway station. Find the minimum number of platforms required for the railway station so that no train is kept waiting.Consider that all the trains arrive on the same day and leave on ...19 likesC++