Home
Gaurav's GitHub Page
Cancel

Level order traversal in spiral form (geeksforgeeks - SDE Sheet)

PROBLEM DESCRIPTION Given a binary tree and the task is to find the spiral order traversal of the tree. Spiral order Traversal mean: Starting from level 0 for root node, for all the even levels w...

Edit Distance (geeksforgeeks - SDE Sheet)

PROBLEM DESCRIPTION Given two strings str1 and str2. Return the minimum number of operations required to convert str1 to str2. The possible operations are permitted: Insert a character at any ...

Rearrange characters (geeksforgeeks - SDE Sheet)

PROBLEM DESCRIPTION Given a string S with repeated characters. The task is to rearrange characters in a string such that no two adjacent characters are the same. Note: The string has only lowercas...

Generate IP Addresses (geeksforgeeks - SDE Sheet)

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...