PROBLEM DESCRIPTION Given a string S containing only digits, Your task is to complete the function genIp() which returns a vector containing all possible combinations of valid IPv4 IP addresses an...
Form a palindrome (geeksforgeeks - SDE Sheet)
PROBLEM DESCRIPTION Given a string, find the minimum number of characters to be inserted to convert it to a palindrome. geeksforgeeks SOLUTION Good Explanation - takeUForward To understand how...
Recursively remove all adjacent duplicates (geeksforgeeks - SDE Sheet)
PROBLEM DESCRIPTION Given a string s, remove all its adjacent duplicate characters recursively. Note: For some test cases, the resultant string would be an empty string. In that case, the functio...
Implement Atoi (geeksforgeeks - SDE Sheet)
PROBLEM DESCRIPTION Given a string s, the objective is to convert it into integer format without utilizing any built-in functions. If the conversion is not feasible, the function should return -1....
Longest Common Substring (geeksforgeeks - SDE Sheet)
PROBLEM DESCRIPTION You are given two strings str1 and str2. Your task is to find the length of the longest common substring among the given strings. geeksforgeeks SOLUTION APPROACH 1 - BRUTE F...
Permutations of a given string (geeksforgeeks - SDE Sheet)
PROBLEM DESCRIPTION Given a string S. The task is to print all unique permutations of the given string that may contain dulplicates in lexicographically sorted order. geeksforgeeks SOLUTION BRU...
Longest Palindrome in a String (geeksforgeeks - SDE Sheet)
PROBLEM DESCRIPTION Given a string str, find the longest palindromic substring in str. Substring of string str: str[ i . . . . j ] where 0 ≤ i ≤ j < len(str). Return the longest palindromic sub...
Longest Distinct characters in string (geeksforgeeks - SDE Sheet)
PROBLEM DESCRIPTION Given a string S, find the length of the longest substring with all distinct characters. geeksforgeeks SOLUTION This can be solved using sliding window. Maintain a HashSet t...
Roman Number to Integer (geeksforgeeks - SDE Sheet)
PROBLEM DESCRIPTION Given a string in roman no format (s) your task is to convert it to an integer . Various symbols and their values are given below. I 1 V 5 X 10 L 50 C 100 D 500 M 1000 geeks...
String Rotated by 2 Places (geeksforgeeks - SDE Sheet)
PROBLEM DESCRIPTION Given two strings a and b. The task is to find if the string ‘b’ can be obtained by rotating (in any direction) string ‘a’ by exactly 2 places. geeksforgeeks SOLUTION class ...