We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
tr " " "\n" | tail +2 | sort | uniq -utr is used so each array element in new line for further processing
tail is used to skip 1st line which contain total no. of array elements
sort for uniq cmd to work as desired
uniq -u print only the uniq element
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Lonely Integer - Bash!
You are viewing a single comment's thread. Return to all comments →
tr " " "\n" | tail +2 | sort | uniq -u
tr is used so each array element in new line for further processing tail is used to skip 1st line which contain total no. of array elements sort for uniq cmd to work as desired uniq -u print only the uniq element