For this Question: Swapnil has finally decided to propose his girlfriend. He is going to write a poem for her. Although he has never written a poem, he thought he should at least give it a try. He knows that a poem contains a lot of <b>Rhyming words</b>. So, he first bought a dictionary. 
Swapnil's dictionary contains N words. He considers two words to be rhyming when the length of their longest common suffix is greater than or equal to K. He would like to find the number of pairs of rhyming words.
Since he went to take rest, can you help him?

<b>Note:</b> Word here refers to a string of lowercase English alphabet and Suffix refers to substring at the end of a string.First line of input contains two integers N, number of words in Swapnil's dictionary and K, his criteria for a word to be rhyming or not.
Next N lines contain words in Swapnil's dictionary.

1 <= N, K <= 100
1 <= Length of Words <= 100Print a single integer denoting the number of pairs of words which are rhyming in nature.Sample Input:
5 3
end
lend
friend
stand
wonderland

Sample Output:
4

Explanation:(LCS - longest common suffix)
{end, lend}: LCS = "end", length = 3, Rhyming words
{end, friend}: LCS = "end", length = 3, Rhyming words
{end, stand}: LCS = "nd", length = 2, Not Rhyming words
{end, wonderland}: LCS = "nd", length = 2, Not Rhyming words
{lend, friend}: LCS = "end", length = 3, Rhyming words
{lend, stand}: LCS = "nd", length = 2, Not Rhyming words
{lend, wonderland}: LCS = "nd", length = 2, Not Rhyming words
{friend, stand}: LCS = "nd", length = 2, Not Rhyming words
{friend, wonderland}: LCS = "nd", length = 2, Not Rhyming words
{stand, wonderland}: LCS = "and", length = 3, Rhyming words, I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
	public static void main (String[] args) throws IOException {

		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String[] input1=br.readLine().split(" ");
		int n=Integer.parseInt(input1[0]);
		int k=Integer.parseInt(input1[1]);
		String str[]=new String[n];
		for(int i=0;i<n;i++){
			str[i]=br.readLine();
		}
		int count=0;
		for(int i=0;i<n-1;i++){
			if(str[i].length()>=k){
			String a=str[i].substring(str[i].length()-k,str[i].length());
			for(int j=i+1;j<n;j++){
				if(str[j].length()>=k){
				String b=str[j].substring(str[j].length()-k,str[j].length());
				if(a.equals(b)){
					count++;
				}
				}
			}
			}
		}
		System.out.println(count);


	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?