One line solution with sed


  • 0
    M
    cat file.txt | sed '10q;d'
    
    

    Parse the file until 10th line then quit(q), line 0 to 9 are deleted with d.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.