Pergunta de entrevista da empresa LinkedIn

The question is how to decide whether the input is a double or not. I answer the question in Java.