It gives me the expected answer, but does not pass the test, anything wrong?


  • 0
    C

    NLINES=$(wc -l < "file.txt")
    awk '{printf "%s ", $1}' file.txt
    if [ $NLINES -ge 2 ]; then
    echo
    fi
    awk '{printf "%s ", $2}' file.txt
    echo


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.