Twitter Interview Report
- 0of 0 votes
AnswersThere is a DNA Strand having values as A , T , C , G.
- saurabh.desi.bhatt October 11, 2016 in United States
All combinations are present in the the file.
Write a method which takes starting mutation string , ending mutation string and string bank and calculates the minimum mutation distance required. But the condition is that either of the start or end must be present in the bank.
Input:
AATTGGCC is starting and TTTTGGCA is ending then mutation distance will be 3.
AATTGGCC - TATTGGCC - TTTTGGCC - TTTTGGCA as it takes three mustaion for start to reach the end string and for this , all intermediate string and final string must be present in the bank.
static int findMutationDistance(String start, String end, String[] bank) {
}| Report Duplicate | Flag | PURGE
Twitter Intern Java - 0of 0 votes
AnswersYou have a string of phrases present. For your simplicity consider them to be integer length.
- saurabh.desi.bhatt October 11, 2016 in United States
String s= " I am Tom"
will be stored in an interger array as [1,2,3] where each represents length of each word in the string.
Write a method to compute the longest subsequence such that it is less than given k value.
Input:
3 //length of array
1 //a[0]
2 //a[1]
3 //a[2]
4 // value of k
Output:
2
Input:
4 //length of array
3
1
2
1
4 //value of k
Output:
3
static int maximumLength(int[] a, int k) {
}| Report Duplicate | Flag | PURGE
Twitter Intern Java