Problem

Given text with lines separated by '\n', return line count (non-empty lines only).

Examples

  • countLines("a b") -> 2
  • countLines("") -> 0
Compile and test (Ctrl+Enter)