Skip to content

Category Archives: Strings

Given an array of strings, find if the given strings can be chained to form a circle. A string X can be put before another… Read More
Given a sorted dictionary (array of words) of an alien language, find order of characters in the language. Examples:   Input: words[] = {"baa", "abcd", "abca",… Read More
Given a range of numbers, print all palindromes in the given range. For example if the given range is {10, 115}, then output should be… Read More
MS Excel columns have a pattern like A, B, C, …, Z, AA, AB, AC, …., AZ, BA, BB, … ZZ, AAA, AAB ….. etc.… Read More
Given a string, check if it is a rotation of a palindrome. For example your function should return true for “aab” as it is a… Read More
A string is said to be palindrome if the reverse of the string is the same as the string. For example, “abba” is a palindrome… Read More
Given a number n and a value k, turn off the kth bit in n. Please note that k = 1 means the rightmost bit.… Read More
Given an array of strings in which all characters are of the same case, write a C function to sort them alphabetically.  The idea is… Read More
Given a keypad as shown in the diagram, and an n digit number, list all words which are possible by pressing these numbers. Before the… Read More
Given two sequences, print the longest subsequence present in both of them. Examples:  LCS for input Sequences “ABCDGH” and “AEDFHR” is “ADH” of length 3. … Read More
Given a string and a positive integer d. Some characters may be repeated in the given string. Rearrange characters of the given string such that… Read More
Given a string, recursively remove adjacent duplicate characters from the string. The output string should not have any adjacent duplicates. See the following examples. Examples: … Read More
Given a stream of characters, find the first non-repeating character from the stream. You need to tell the first non-repeating character in O(1) time at… Read More
Recently, I have been through the interview experience of Amazon India and I would like to share my experience with everyone. Position: SDE- 1 No.… Read More
Given three strings A, B and C. Write a function that checks whether C is an interleaving of A and B. C is said to… Read More

Start Your Coding Journey Now!