leetcodeSolution to some Leetcode problems written in C++ |
git clone git://git.dimitrijedobrota.com/leetcode.git |
Log | Files | Refs | README | LICENSE |
0194.sh (243B)
0 // original 1 for i in $(head -n1 file.txt | wc -w | xargs seq 1); do cut -d ' ' -f$i file.txt | xargs; done 2 3 // same idea, little bit more elegant 4 head -n1 file.txt | wc -w | xargs seq 1 | xargs -n1 -i{} sh -c "cut -d' ' -f{} file.txt | xargs"