File tree Expand file tree Collapse file tree 4 files changed +4
-4
lines changed
src.save/main/java/g0101_0200
s0193_valid_phone_numbers Expand file tree Collapse file tree 4 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 11# Read from the file words.txt and output the word frequency list to stdout.
22# #Medium #Shell #2022_06_28_Time_143_ms_(54.55%)_Space_3.7_MB_(85.88%)
3- sed -e ' s/ /\n/g' words.txt | sed -e ' /^$/d' | sort | uniq -c | sort -r | awk ' {print $2" "$1}'
3+ sed -e ' s/ /\n/g' words.txt | sed -e ' /^$/d' | sort | uniq -c | sort -r | awk ' {print $2" "$1}'
Original file line number Diff line number Diff line change 11# Read from the file file.txt and output all valid phone numbers to stdout.
22# #Easy #Shell #2022_06_28_Time_112_ms_(75.54%)_Space_3.1_MB_(53.89%)
3- egrep ' ^[0-9]{3}-[0-9]{3}-[0-9]{4}$|^\([0-9]{3}\)\s[0-9]{3}-[0-9]{4}$' file.txt
3+ egrep ' ^[0-9]{3}-[0-9]{3}-[0-9]{4}$|^\([0-9]{3}\)\s[0-9]{3}-[0-9]{4}$' file.txt
Original file line number Diff line number Diff line change 55while [[ $col_n -le $wordcount ]]; do
66 awk " { print \$ $col_n }" file.txt | paste -sd " "
77 col_n=$(( col_n + 1 ))
8- done
8+ done
Original file line number Diff line number Diff line change 11# Read from the file file.txt and output the tenth line to stdout.
22# #Easy #Shell #2022_06_28_Time_26_ms_(99.36%)_Space_3.6_MB_(79.41%)
3- sed -n 10p file.txt
3+ sed -n 10p file.txt
You can’t perform that action at this time.
0 commit comments