All Questions
2 questions
0
votes
1
answer
454
views
Efficient way to separate text file to header, tail lines and the leftover in between
I'm looking for a more efficient algorithm for the following problem:
The input of the algorithm is a text file and two non-negative integer numbers - the number of headers and the number of tails.
...
3
votes
3
answers
1k
views
Quickly compute added and removed lines
I'm trying to compare two text files. I want to compute how many lines were added and removed. Basically what git diff --stat is doing. Bonus points for not having to store the entire file contents in ...