@@ -0,0 +1,1277 @@
+//https://www.hackerrank.com/challenges/kaprekar-numbers%0Aimport java.io.*;%0Aimport java.util.*;%0A%0Apublic class Solution %7B%0A    public static void main(String%5B%5D args) throws IOException %7B%0A        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));%0A        %0A        //Get inputs%0A        final int P = Integer.parseInt(br.readLine());%0A        final int Q = Integer.parseInt(br.readLine());%0A        %0A        //Create array to store Kaprekar Numbers%0A        ArrayList%3CInteger%3E kaprekars = new ArrayList%3CInteger%3E();%0A        %0A        //Find Kaprekar numbers between P and Q (inclusive)%0A        for(int i = P; i %3C= Q; ++i)%7B%0A            long sqI = (1L*i)*i;%0A            int divisor = (int)Math.pow(10, Math.floor(Math.log10(i)) + 1);%0A            int left = (int)Math.floor(sqI / divisor);%0A            int right = (int)(sqI %25 divisor);%0A            if(left + right == i)%7B%0A                kaprekars.add(i);%0A            %7D%0A        %7D%0A        %0A        //Output Kaprekar numbers%0A        if(kaprekars.size() %3C 1)%7B%0A            System.out.print(%22INVALID RANGE%22);%0A        %7D else %7B%0A            StringBuffer sb = new StringBuffer();%0A            for(Integer k : kaprekars)%7B%0A                sb.append(k).append(%22 %22);%0A            %7D%0A            System.out.print(sb);%0A        %7D%0A    %7D%0A%7D%0A

Create kaprekar-numbers.java