Given a string in the form of a Linked List, check whether the string is palindrome or not.
1. Find the length of the total string
2. Get the node that has the mid (middle) position
3. Break the List at that node
4. Reverse the first half
5. Now do string compare
Complete working solution can be found here
Given an array of words (i.e. [“apple”, “paris”, “boar”, “cat”, “tree”, “mango”]), find the max value of length(s) * length(t), where s and t are words from the array. The catch here is that the two words cannot share any characters. Assume that there are many words in the array (N words) and average length of word is M. Answer for the example above is “tree” and “mango” and the result is 4 * 5 = 20.
Hint: Hash each word, compare the hashes and get the max. You can find the solution here