Skip to content

Instantly share code, notes, and snippets.

@roblogic
Created March 25, 2019 23:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roblogic/c856c9607b5d29ff856d1c45c8807a75 to your computer and use it in GitHub Desktop.
Save roblogic/c856c9607b5d29ff856d1c45c8807a75 to your computer and use it in GitHub Desktop.
Golf solution to "The third string", https://codegolf.stackexchange.com/a/182195/15940
[ ${#1} = 0 ]&&{ x="$2";}||{ x="$1";}
for((;i++<4;)){
o=$i${x:1}
[[ $o != $1 ]]&&[[ $o != $2 ]]&&{ echo $o;exit;}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment