Skip to main content
2 of 7
added 46 characters in body
Doorknob
  • 71.7k
  • 20
  • 143
  • 385

Ruby, 25 24 bytes

->a{"#{a}"!~/\D0|^\[\]/}

This is a proc that takes one argument, the array to be tested.

->a{
"#{a}"    # convert argument to string
!~        # does not match the regex...
/\D0      # a non-digit (don't match "10"!) followed by a 0
|         # or...
^\[\]/    # [] at the beginning of the string (signifying the empty array)
}
Doorknob
  • 71.7k
  • 20
  • 143
  • 385