There are few people in a meeting-room and each one of them wears a blue or a grey shirt. Every person counts the number of people wearing blue shirts. You are given a single dimensional array where these counts are recorded. Find out the total number of people wearing the blue shirts? If the given array is invalid, then print "Invalid". Some of these arrays can be:
1. Count[]={2,1,1}
2. Count[]={2,2,2,2,2,2}
3. Count[]={2,10}
negative regexp
-
if you want to grep anything except foo, use grep -v or negative lookahead
echo -e 'foo\nbar\nboz'|grep -P '^(?!.*foo).*$' bar boz it is just so
beautiful ...
1 month ago
No comments:
Post a Comment