ProDeveloperTutorialonDecember 24, 2024 Unique Paths II in CPP Problem Explanation: A robot is located at the top-left corner of a m x n grid. The robot can only move either down or right at any point in…
ProDeveloperTutorialonDecember 24, 2024 Unique Paths Solution in CPP A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below). The robot can only move either…
ProDeveloperTutorialonDecember 24, 2024 Rotate linked list by k nodes Example 1: Input: 1->2->3->4->5->NULL, k = 2 Output: 4->5->1->2->3->NULL Explanation: rotate 1 steps to the…
ProDeveloperTutorialonDecember 24, 2024 Intersection of Two Linked Lists in c++ Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: A:…
ProDeveloperTutorialonDecember 24, 2024 Wildcard Matching Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for ‘?’ and ‘*’.…
ProDeveloperTutorialonDecember 24, 2024 Given a positive integer n, generate a square matrix filled with elements from 1 to n2 in spiral order in C++ Input: 3 Output: [ [ 1, 2, 3 ], [ 8, 9, 4 ], [ 7, 6, 5 ] ] Before looking into the solution, I recommend you to please go through print matrix…
ProDeveloperTutorialonDecember 24, 2024 Reverse Linked List iterative and recursive in C++ Example: Input: 1->2->3->4->5->NULL Output: 5->4->3->2->1->NULL This problem can be solved in 2 ways. 1.…
ProDeveloperTutorialonDecember 24, 2024 Merge Intervals in C++ Given a collection of intervals, merge all overlapping intervals. Example 1: Input: [[1,3],[2,6],[8,10],[15,18]] Output:…
ProDeveloperTutorialonDecember 24, 2024 Given an array of non-negative integers determine if you are able to reach the last index in C++ Explanation: Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array…
ProDeveloperTutorialonDecember 24, 2024 Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. Example 1: Input: [ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ] Output: [1,2,3,6,9,8,7,4,5] The Solution is very simple. As shown in the image…