GAURAV YADAVgaurav246blogs.hashnode.dev·Jan 11, 2024151 DSA Problem journeyQ22: Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any order. A mapping of digits to letters (just like on the telephone buttons) is given below. Not...Discuss·20 likesC++

GAURAV YADAVgaurav246blogs.hashnode.dev·Jan 9, 2024151 DSA Problem journeyQ21:Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numbers sum to target. Each number in candidates may only be used once in the combination. Note: The...Discuss·16 likesC++

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...Discuss·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...Discuss·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...Discuss·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...Discuss·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] ...Discuss·14 likesC++

Xander Billablogs.xanderbilla.com·Dec 19, 2023Sorting Algorithms: Understanding Bubble SortIntroduction Sorting is a fundamental operation in computer science, and various algorithms have been developed to efficiently organize data. One such algorithm is Bubble Sort. In this blog post, we will explore the Bubble Sort algorithm, provide its...DiscussData Structure And Algorithmdata structures

Xander Billablogs.xanderbilla.com·Dec 18, 2023Efficient Array Deletion : End, Beginning, and Arbitrary PositionIntroduction Arrays are fundamental data structures in programming, and understanding how to efficiently delete elements from them is crucial. In this blog post, we'll explore three common scenarios: deleting an element at the end, at the beginning, ...DiscussData Structure And Algorithmarray

GAURAV YADAVgaurav246blogs.hashnode.dev·Dec 8, 2023151 DSA Problem journeyQ5:)Given an array nums of size n, return the majority element.The majority element is the element that appears more than ⌊n / 2⌋ times. You may assume that the majority element always exists in the array. Example: Input: nums = [3,2,3] Output: 3 So...Discuss·11 likes·146 readsC++