Skip to content

Commit 932b91b

Browse files
authored
Runtime: 38ms (Top 81.29%) | Memory: 3.7 MB (Top 33.84%)
1 parent 5554cbd commit 932b91b

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed
+1-12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Solution 1
1+
# Runtime: 38ms (Top 81.29%) | Memory: 3.7 MB (Top 33.84%)
22
cnt=0
33
while read line && [ $cnt -le 10 ]; do
44
let 'cnt = cnt + 1'
@@ -7,14 +7,3 @@ while read line && [ $cnt -le 10 ]; do
77
exit 0
88
fi
99
done < file.txt
10-
11-
# Solution 2
12-
awk 'FNR == 10 {print }' file.txt
13-
# OR
14-
awk 'NR == 10' file.txt
15-
16-
# Solution 3
17-
sed -n 10p file.txt
18-
19-
# Solution 4
20-
tail -n+10 file.txt|head -1

0 commit comments

Comments
 (0)