Yes or No!Optional Node
Not only do users write whole words instead of single characters, but they sometimes use capital letters instead of lowercase ones. Also, they may leave whitespace before their actual answer.
Create a method that checks the first non-whitespace character and returns a number according to the following table.
Note: This challenge can be solved in any language, but the provided boilerplate is for Java.
|first actual character of input||return following int|
|'y' or 'Y'||1|
|'n' or 'N'||0|