Read all of stdin. Print the number of lines that contain at least one non-whitespace character.
Example: stdin: error: timeout <blank> ok stdout: 2
Useful when skimming logs and metrics dumps.
// code challenge
~15 min
SRE-flavored warm-up: count log lines that are not blank.
Read all of stdin. Print the number of lines that contain at least one non-whitespace character.
Example: stdin: error: timeout <blank> ok stdout: 2
Useful when skimming logs and metrics dumps.
Language: · Judge0
// sample tests
stdin "a\nb\nc\n" → stdout "3"stdin "x\n\ny\n" → stdout "2"stdin "\n\n" → stdout "0"Sign in to run and submit.
⌘/Ctrl+Enter run · ⌘/Ctrl+Shift+Enter submit · Esc exits fullscreen
Run your code to see test results here.