Project Euler #8: Largest product in a series - Hacker Rank Program

Problem Statement
This problem is a programming version of Problem 8 from projecteuler.net
Find the greatest product of K consecutive digits in the N digit number.
Input Format
First line contains T that denotes the number of test cases.
First line of each test case will contain two integers N & K.
Second line of each test case will contain a N digit integer.
Output Format
Print the required answer for each test case.
Constraints
1T100
1K7
KN1000
Sample Input
2
10 5
3675356291
10 5
2709360626
Sample Output
3150
0
 MY SOLUTION:

import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

public class Solution {

    public static void main(String[] args) {
        Scanner s=new Scanner(System.in);
        int t=s.nextInt();
        while(t!=0)
            {
            int k=s.nextInt();
            int n=s.nextInt();
            String a=s.next();
            int i,j,count=0,max=0,sum=1;
            j=n;
            while(j!=k)
            {
                 String b=a.substring(count,j);
                 count++;
                 j++;
                sum=1;
               for(i=0;i<b.length();i++)
                {
                 sum=sum*Character.getNumericValue(b.charAt(i));
               }
               if(max<sum)
               max=sum;
            }
            System.out.println(max);
            }
            t--;
        }
    }

Convert resultset object to list of map

Convert the resultset object to list of map In some cases, while we doing API automation, we need to fetch the value from the DB and hav...