Added valid number java solution