Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local lines = {}
- -- read the stdin and count the duplicate lines
- for line in io.lines() do
- lines[line] = lines[line] and lines[line]+1 or 1
- end
- -- print out lines occur more than once
- for k, v in pairs(lines) do
- if v > 1 then io.write(k, "\n") end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement