Company: citi_16oct
Difficulty: medium
Contact Search Problem Description When you open the dialer of your phone and start typing a number, you will probably get search results from the saved contacts for the number you entered. Your task is to implement a similar feature. Saved contacts are numbered from 0 to N-1. They are represented by two arrays A, B of N strings each. Name of K-th contact is A[K] and phone number is B[K]. Write a function: class Solution { public String solution(String[] A, String[] B, String P); } which, given two arrays A and B and a string P of length M representing a partial phone number, returns the contact name whose phone number contains P as a substring, that is a contiguous segment (for example, "436800143" contains as a substring "6800", but not "3614"). If there is more than one contact matching the search criteria, your function should return the alphabetically smallest contact name. If no match is found, your function should return "NO CONTACT". Examples Example 1: Input: A = ["pim", "pom"