Easy Level
I have got 70/100 in this level. Question was based on palindrome and I had to find the biggest palindrome length from combination of a string. In starting, I had an array of students's name and and than I had pick first latter of all name and made a string from them. Now I made an array based on combination of this string.
Input: {"Bharti", "Bharat", "Akash", "Bhaviye", "Chand", "Brijesh","Chetak", "Arvind", "Bhavna"}
Output: 7
Program: Palindrome problem program
Note: We can use Manchester code to find out biggest palindrome length but I have wrote code before knowing about this. Manchester code is better than my code.
Medium Level
I have got 100/100 in this level. Question was based on graph and they described as cities attack problem. They gave cities with connected road and I had to cover the longest road which covers maximum cities and I could not go back from destroyed city.
Input: {"1#2", "2#3","3#4","3#5","5#6","5#7","6#7","7#8"}
Output: 7
1#2 means city 1 is connected to city 2 and answers is maximum covered cities via a road.
Program: Cities attack problem
Note: This program works for connected and dis-connected graph to find the maximum number of nodes via a path or this can be used to find biggest path in a graph.
Expert Level
Got 100/100 and this level was very easy for me. They gave an array of string and I had to find the last string from the difference of next array index to current array index.
input: 2 1 3 4
-1 2 1
3 -1
-4
output: -4
Hope, you all like this post and programs. Share it to help others.
Related Tutorials:-
★ Android-Geeks
★ Check whether a string is a Palindrome or not
★ Magic Square Game
★ Convert a given number into string
★ Tic Tac Toe Game
Great work bro!
ReplyDeleteThanks :)
Delete