Reverse characters of each word in a sentence
--------- "my career stack" ---------
Reverse the characters of each word, keeping the order of the words same such that the output will be
--------- "ym reerac kcats" ---------
Minimum cost for painting a row houses in three different colors
Find the color of each house such that no two adjacent house have the same color and the total cost of coloring all the houses is minimum.
Update: The question intends to state that cost of painting any house in any color is different, so if cost of painting House 1 in Red is say, X then the cost of painting House 2 in red will some other value Y. It can be considered each house has different dimensions and hence cost of painting in each color is different, and the cost of paint for each house also varies
How to convert singly linked list to binary search tree?
Find the intervals from a set of intervals in which a given point lies
Find elements that sum to a given value in a balanced BST
6 3 8 1 4 7 12
sum = 16 o/p should be 4 and 12
Number of occurrences of a number in a sorted array.
Given a preorder and a postorder traversal, construct the tree.
Validate a Binary Search Tree
What is the minimum number of comparisons required to find the largest and the second largest elements in an array
If it makes your life easier you can use extra space. But try to keep it less.
Finding non-anagramic strings in a list