"give a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime."
So grab a paper and a pen and try to be a computer. What would you do if you need to achieve desired result manually:
- in order to keep longest lines you have to check all lines, right? So - go through file line by line
- in order to keep longest lines you have to know length of every line, right? So - determine length of every line
Now just pick the longest ones (there is ambiguity in task description and therefore I don't know what exactly and in which order should be picked).
Implement it in Python and off you go.
So grab a paper and a pen and try to be a computer. What would you do if you need to achieve desired result manually:
- in order to keep longest lines you have to check all lines, right? So - go through file line by line
- in order to keep longest lines you have to know length of every line, right? So - determine length of every line
Now just pick the longest ones (there is ambiguity in task description and therefore I don't know what exactly and in which order should be picked).
Implement it in Python and off you go.
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.