ProDeveloperTutorialonDecember 25, 2024 Restore IP Addresses Given a string containing only digits, restore it by returning all possible valid IP address combinations. Example: Input:…
ProDeveloperTutorialonDecember 25, 2024 Reverse a linked list from position m to n. Do it in one-pass. Note: 1 ≤ m ≤ n ≤ length of list. Example: Input: 1->2->3->4->5->NULL, m = 2, n = 4 Output: 1->4->3->2->5->NULL…
ProDeveloperTutorialonDecember 25, 2024 Decode Ways A message containing letters from A-Z is being encoded to numbers using the following mapping: ‘A’ -> 1 ‘B’ -> 2…
ProDeveloperTutorialonDecember 25, 2024 check if the given string is valid or not explanation with solution Validate if a given string is numeric. Some examples: “0” => true ” 0.1 ” => true “abc” => false…
ProDeveloperTutorialonDecember 25, 2024 Subsets II in CPP Given a collection of integers that might contain duplicates, nums, return all possible subsets (the power set). Note: The solution set must…
ProDeveloperTutorialonDecember 25, 2024 The gray code is a binary numeral system where two successive values differ in only one bit. Given a non-negative integer n representing the total number of bits in the code, print the sequence of gray code. A gray code sequence must…
ProDeveloperTutorialonDecember 25, 2024 Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the original relative order of the nodes in each of the two partitions. Example: Input: head =…
ProDeveloperTutorialonDecember 25, 2024 Remove Duplicates from Sorted List solution in CPP Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. Example 1:…
ProDeveloperTutorialonDecember 25, 2024 Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [0,0,1,2,2,5,6] might become [2,5,6,0,0,1,2]). You are given a target value to search. If found in the array return true, otherwise…
ProDeveloperTutorialonDecember 25, 2024 Given a sorted array nums, remove the duplicates in-place such that duplicates appeared at most twice and return the new length. Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory. Example 1: Given…