Skip to content

Commit 4e2973f

Browse files
committed
Create 194.transpose-file.sh
1 parent 95e3fd4 commit 4e2973f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

194.transpose-file.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# https://leetcode.cn/problems/valid-phone-numbers/
2+
# Date: 2023.08.05
3+
# Pass/Error/Bug: 1/1/0
4+
# 执行用时: 0 ms, 击败 100.00% 使用 Bash 的用户
5+
# 内存消耗:3.85 MB, 击败 9.31% 使用 Bash 的用户
6+
7+
# Read from the file file.txt and print its transposed content to stdout.
8+
awk '{for(i=1; i<=NF; i++){a[i]=a[i]" "$i;}}END{for(i=1; i<=NF; i++){print a[i];}}' file.txt | sed 's/^ *//'

0 commit comments

Comments
 (0)