ProDeveloperTutorialonDecember 24, 2024 Group Anagrams in C++ Given an array of strings, group anagrams together. Example: Input: ["eat", "tea", "tan", "ate",… Discover More
ProDeveloperTutorialonDecember 24, 2024 You are given an n x n 2D matrix rotate it by 90 degrees (clockwise) in C++. Note: You have to rotate the image in-place, which means you have to modify the input 2D matrix directly. DO NOT allocate another 2D matrix… Discover More
ProDeveloperTutorialonDecember 24, 2024 Given a collection of numbers that might contain duplicates, return all possible unique permutations in C++ Example: Input: [1,1,2] Output: [ [1,1,2], [1,2,1], [2,1,1] ] In my pervious post we have discussed three solutions where the numbers are… Discover More
ProDeveloperTutorialonDecember 24, 2024 Given a collection of distinct integers, return all possible permutations. Example: Input: [1,2,3] Output: [ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1] ] The solution for this problem can be solved in 2… Discover More
ProDeveloperTutorialonDecember 24, 2024 Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string. Example 1: Input: num1 = "2", num2 = "3" Output: "6" Example 2: Input: num1 = "123", num2 =… Discover More
ProDeveloperTutorialonDecember 24, 2024 Given a collection of candidate numbers and a key, find all unique combinations in candidates where the candidate numbers sums to target. Each number in candidates may only be used once in the combination. Note: • All numbers (including target) will be positive integers. • The… Discover More
ProDeveloperTutorialonDecember 24, 2024 Merge k sorted linked lists and return it as one sorted list in C++ Example: Input: [ 1->4->5, 1->3->4, 2->6 ] Output: 1->1->2->3->4->4->5->6 This problem can be solved by… Discover More
ProDeveloperTutorialonDecember 24, 2024 Given an array sorted in ascending order and is rotated at some pivot, given a target value to search, if found in the array return its index Problem explanation: Initial Sorted array: [0,1,2,4,5,6,7] After rotation it becomes [4,5,6,7,0,1,2]. Target = 0 Index = 4 [as array index… Discover More
ProDeveloperTutorialonDecember 24, 2024 Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possible, it must rearrange it as the lowest possible order (ie, sorted in ascending order). Examples: Input ->… Discover More
ProDeveloperTutorialonDecember 24, 2024 Given two integers dividend and divisor, divide two integers without using multiplication, division and mod operator. Return the quotient after dividing dividend by divisor. The integer division should truncate toward zero. Example 1: Input: dividend = 10,… Discover More