Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options user 17772

A competition to solve a particular problem through the usage and manipulation of arrays.

0
votes
bash (79) (($#<3))&&echo $1 ${2/#/and }||{ Y=${@/%/,};L=${@: -1};echo ${Y/%$L,/and $L}; } Explaination For 1 or 2 parameters echo $1 and, if $2 exists, prefix $2 with "and ". Otherwise suff …
answered Jun 10 '17 by philcolbourn
12
votes
26answers
This is a Google interview question, see here for a youtube link. The task: Find 2 integers from an unordered list that sum to a given integer. Given an unordered list of integers, find 2 integers …
asked Mar 20 '17 by philcolbourn
5
votes
Bash, 84 bytes My implementation of (roughly) Google's engineer's solution but using bash and an input stream - not my solution, so this does not count. while read V;do((V<$1))&&{ ((T=R[V]))&&echo $ …
answered Mar 20 '17 by philcolbourn
0
votes
Bash, 34 bytes I output each list element on a new line as someone else did - bash only has 1-D arrays: for((;c<=$#;c++)){ echo ${*:1:c};} Could be 1 byte less but this does not work for null case …
answered Dec 13 '18 by philcolbourn