Question 1 - Valid Parenthesis
St linkedin we JSON/yaml/hocon config files in many differetn places to configure our services and application.
Fro example what security keys should we use to configure connections to the database?
Therefroe we have config validatros that validate that when u change the config.
It would correctly compile and it is correctly formed or u csn quite literally take down multiple services.
This function determins if the parathesis ‘(‘ and ‘)’ in a string are proeprly matches.
Input
[A-Za-z0-9].* String
Output: Boolean
Some example :
“()()()()” -> true
“((45+)*a3)” —> true
Public boolesn matched(String s){}Question 2 - Variant of https://leetcode.com/problems/letter-combinations-of-a-phone-number/
/**
* Given the standard mapping from English letters to digits on a phone keypad (1 → "" 2 -> a,b,c 3 -> d,e,f 4 -> g,h,i 5 -> j,k,l 6 -> m,n,o 7 -> p,q,r,s 8 -> t,u,v 9 -> w,x,y,z),
* write a program that outputs all words that can be formed from any n-digit phone number from the list of given KNOWN_WORDS considering the mapping mentioned above.
*
*
* KNOWN_WORDS= ['careers', 'linkedin', 'hiring', 'interview', 'linkedgo']
*
* phoneNumber: 2273377
* Output: ['careers']
*
* phoneNumber: 54653346
* Output: ['linkedin', 'linkedgo']
*/
Public class WordFinderFromPhoneNumber{
Private static finsl String[] KEYBOARD ={“”, “abc”,”def”, “ghid”, “jkl”,”mno”,”pqrs” “tuv” “wxyz”};
Private static fins List<String> KNWOEN_WORDS;
Public static List<String> wordsFromPhoneNumbers?(string phpneNumber){}
}```