Check if a string is a rotated palindrome or not
Given a string, check if it is a rotated palindrome or not. For example, CBAABCD is a rotated palindrome as it is a rotation of palindrome ABCDCBA.
Ace your Coding Interview
Get hired by top tech companies with our comprehensive interview preparation.
Get StartedGiven a string, check if it is a rotated palindrome or not. For example, CBAABCD is a rotated palindrome as it is a rotation of palindrome ABCDCBA.
Check if a given set of moves is circular or not. A move is circular if its starting and ending coordinates are the same. The moves can contain instructions to move one unit in the same direction (M), to change direction to the left of current direction (L), and to change direction to the right of current direction (R).
Given a simple sentence and a set of syntax rules, validate if it is syntactically correct or not.
Given a string, print it backwards using recursion.
Write a program to in-place remove all extra spaces from a string. There maybe leading spaces, trailing spaces, or consecutive spaces between words of the string.
Given an M × N matrix of characters, find all occurrences of a given string in the matrix. We are allowed to search the string in all eight possible directions. Note that there should not be any cycles in the output path.
Write code to evaluate a given postfix expression efficiently. For example, 82/ will evaluate to 4 (8/2), 138×+ will evaluate to 25 (1+8×3) and 545×+5/ will evaluate to 5 ((5+4×5)/5).
Given a balanced expression that can contain opening and closing parenthesis, check if the expression contains any duplicate parenthesis or not.
Given a string containing opening and closing braces, check if it represents a balanced expression or not.
Write a program to determine if a given string is palindrome or not. A palindromic string is a string that remains the same with its characters reversed.
Given a list of strings where no string is a substring of another, find the shortest string that contains each string in the list as a substring.
This post will discuss the difference between a subarray, a substring, a subsequence, and a subset.