36. Write a Java program to check whether two strings are interliving of a given string. Assuming that the unique characters in both strings. Go to the editor

Sample Output:

The given string is: PMQNO
The interleaving strings are MNO and PQ
The given string is interleaving: true
The given string is: PNQMO
The interleaving strings are MNO and PQ
The given string is interleaving: false

49. Write a Java program to find first non-repeating character from a stream of characters. Go to the editor

Sample Output:

String: godisgood
Reading: g
The first non-repeating character so far is: g
Reading: o
The first non-repeating character so far is: g
Reading: d
The first non-repeating character so far is: g
Reading: i
The first non-repeating character so far is: g
Reading: s
The first non-repeating character so far is: g
Reading: g
The first non-repeating character so far is: o
Reading: o
The first non-repeating character so far is: d
Reading: o
The first non-repeating character so far is: d
Reading: d
The first non-repeating character so far is: i

60. Write a Java program to read two strings append them together and return the result.
If the strings are different lengths, omit chars from the beginning of longer string and make them equal length. Go to the editor

64. Write a Java program to read a string and if a substring of length two appears at both its beginning and end,
return a string without the substring at the beginning otherwise, return the original string unchanged. Go to the editor

69. Write a Java program to return the substring that is between the first and last appearance of the substring 'toast' in the given string,or return the empty string if substirng 'toast' does not exists. Go to the editor

70. Write a Java program to check whether a string is pq-balanced or not.A String is pq-balanced if for all the p's in the string atleast one 'q' must exists right of the p's.But 'q' before the 'p' makes the pq-balanced false. Go to the editor

Sample Output:

The given strings is: gfpmpnppqab
The string is pq-balanced? true
The given strings is: gfpmpnpqpab
The string is pq-balanced? false

74. Write a Java program to return whether a prefix string made of the first N specific characters of the string appear somewhere else in the string. Go to the editor

Sample Output:

The given strings is: MrsJemsmrsam
The prefix string length is: 3
Is 'Mrs' appear else where in the string? false
The given string is: MrsJemsMrsam
The prefix string length is: 3
Is 'Mrs' appear else where in the string? true

75. Write a Java program to check whether a string 'abc' in the middle of a given string. Here middle means
the number of character to the left and right of the substring 'abc' must differ by at most one. Go to the editor

Sample Output:

The given string is: xxxabcxxxxx
Is abc appear in middle? false
The given string is: xxabcxxx
Is abc appear in middle? true

76. Write a Java program to count how many times the substring 'life' present at anywhere in a given string. Counting can also happen for the substring 'li?e', any character instead of 'f'. Go to the editor

Sample Output:

The given string is: liveonwildlife
The substring life or li?e appear number of times: 2

80. Write a Java program to check whether the character immediately before and after of # is same in a given string. Go to the editor

Sample Output:

The given string is: moon#night
The before and after character are same: true
The given string is: bat##ball
The before and after character are same: false
The given string is: #moon#night
The before and after character are same: true

85. Write a Java program to make a new string with each character of just before and after of t-string whichever it appears in m-string. Assume that m-string and non-empty t-string has given. Go to the editor

87. Write a Java program to check whether a z is happy or not. A 'z' is happy when there is another 'z' immediately to its left or right.Return true if all the z's in the given string are happy. Go to the editor

Sample Output:

The given string is: azzlea
Is z happy in the string: true
The given string is: azmzlea
Is z happy in the string: falses