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.
uniq -c -i: This command counts the number of occurrences of each unique line in the input, ignoring case for comparisons. The -c option tells the uniq command to prefix each line with its count, and the -i option tells it to ignore case when comparing lines.
sed 's/^\s*//': This command is a sed script that removes any leading whitespace from each line of input. The s/^\s*// command tells sed to find any whitespace at the beginning of each line ^, and then delete it // along with any other whitespace that follows.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
'Uniq' command #3
You are viewing a single comment's thread. Return to all comments →
uniq -c -i
: This command counts the number of occurrences of each unique line in the input, ignoring case for comparisons. The-c
option tells the uniq command to prefix each line with its count, and the-i
option tells it to ignore case when comparing lines.sed 's/^\s*//'
: This command is a sed script that removes any leading whitespace from each line of input. Thes/^\s*//
command tellssed
to find any whitespace at the beginning of each line^
, and then delete it//
along with any other whitespace that follows.