ProDeveloperTutorialonDecember 25, 2024 Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. Example: Input: "aab" Output: [ ["aa","b"],…
ProDeveloperTutorialonDecember 25, 2024 Surrounded Regions A region is captured by flipping all ‘O’s into ‘X’s in that surrounded region. DFS: We can solve this problem in 2…
ProDeveloperTutorialonDecember 25, 2024 Woord Ladder You are given 2 words beginWord and endWord. You need to return the number of words, that will transform from beginWord to endWord beginWord =…
ProDeveloperTutorialonDecember 25, 2024 Best time to buy sell stock You are given an array with the price of the stock on the ith day. You need to max the profit by choosing a day to buy and choosing different…
ProDeveloperTutorialonDecember 25, 2024 Given a triangle, find the minimum path sum from top to bottom. Given a triangle, find the minimum path sum from top to bottom. In each step you can only move to adjacent numbers on the row below. For…
ProDeveloperTutorialonDecember 25, 2024 Check if the given board is valid Sudoku or not explanation with solution in CPP Determine if a 9×9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules: 1. Each row must…
ProDeveloperTutorialonDecember 25, 2024 Pascal’s triangle 2 Before solving this, have a look at similar problem “pascal’s triangle”. Given a non-negative integer numRows, generate the first numRows of…
ProDeveloperTutorialonDecember 25, 2024 Given a non-negative integer numRows, generate the first numRows of Pascal’s triangle. n Pascal’s triangle, each number is the sum of the two numbers directly above it. Example: Input: 5 Output: [ [1], [1,1], [1,2,1],…
ProDeveloperTutorialonDecember 25, 2024 Insert Interval Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary). You may assume that the intervals…
ProDeveloperTutorialonDecember 25, 2024 Restore IP Addresses Given a string containing only digits, restore it by returning all possible valid IP address combinations. Example: Input:…