Get first matched string having the given keyword - Java Quiz Question


Write a program to get the first matched string having the given keyword from the list of words. The search should not be case sensitive.

Input (List, String) Output (String)
[RHOB, NPHI, DT, GR, RHO8], RHO RHOB
[roja, saroja, neeraja, Rajesh, Raja], Raj neeraja
[kaLPAna, pandey, pandari, anand], aNd pandey
[kaLPAna, pandey, pandari, anand], RHO null


import java.util.List;
import java.util.ArrayList;
class GetFirstMatchHavingKeyword
{
    public static void main(String s[])
    {
        ArrayList<String> strings = new ArrayList<String>();
        strings.add("RHOB");
        strings.add("NPHI");
        strings.add("DT");
        strings.add("GR");
        strings.add("RHO8");
        System.out.println("The first match having the keyword RHO is : " + getFirstMatch(strings, "RHO"));

    }


    public static String getFirstMatch(List<String> strings, String keyword) {
    }

}