Need help with reduce function

At the end of your query, try replacing RETURN paths with:

WITH paths WHERE paths <> ''
RETURN paths