leetcode

Solution to some Leetcode problems written in C++
git clone git://git.dimitrijedobrota.com/leetcode.git
Log | Files | Refs | README | LICENSE

0194.sh (243B)


      1 // original
      2 for i in $(head -n1 file.txt | wc -w | xargs seq 1); do cut -d ' ' -f$i file.txt | xargs; done
      3 
      4 // same idea, little bit more elegant
      5 head -n1 file.txt | wc -w | xargs seq 1 | xargs -n1 -i{} sh -c "cut -d' ' -f{} file.txt | xargs"