Zhuanli&Blog


  • 首页

  • 标签

  • 分类

  • 归档

leetcode 194. Transpose File

发表于 2018-09-25 | 分类于 leetcode

题目链接:leetcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Read from the file file.txt and print its transposed content to stdout.
awk '
{
for (i = 1; i <= NF; i++) {
if (FNR == 1) {
t[i] = $i;
} else {
t[i] = t[i] " " $i
}
}
}
END {
for (i = 1; t[i] != ""; i++) {
print t[i]
}
}
' file.txt
# awk
leetcode 187. Repeated DNA Sequences
leetcode 199. 二叉树的右视图

zhuanli

194 日志
9 分类
41 标签
GitHub
© 2018 — 2019 zhuanli
由 Hexo 强力驱动
|
主题 — NexT.Pisces v5.1.4