← previousnext →
Problem
Given text with lines separated by '\n', return line count (non-empty lines only).
Examples
countLines("a b") -> 2countLines("") -> 0
Given text with lines separated by '\n', return line count (non-empty lines only).
countLines("a
b") -> 2countLines("") -> 0