Leetcode / 195. Tenth Line
Pick a programming language:
Here is the source code for the solution to this problem.
# Read from the file file.txt and output the tenth line to stdout.
# Solution 1
head -n 10 file.txt | tail -n +10
# Solution 2
# awk 'NR==10' file.txt
# Solution 3
# sed '10!D' file.txt
Did you like the lesson? 😆👍
Consider a donation to support our work: