• + 1 comment

    Tried to go with a pure bash approach but in the submission the test case 2 doesn't pass because potatoes... any clue? Malformed input data maybe? I copied and pasted the input data locally and it works without any issue...

    while read; do
        STUDENT=`echo "$REPLY" | cut -c1`
        INFO=`echo "$REPLY" | cut -d ' ' -f2-4 | tr ' ' $'\n' | sort -n`
        for each_qualification in $INFO; do
            [ $each_qualification -ge 50 ] || break
        done
        [ $each_qualification -ge 50 ] && echo "$STUDENT : Pass" || echo "$STUDENT : Fail"
    done