Skip to content

Instantly share code, notes, and snippets.

@p53ud0k0d3
Created March 19, 2015 14:17
Show Gist options
  • Save p53ud0k0d3/4fd24c9d83a5b8ccb04f to your computer and use it in GitHub Desktop.
Save p53ud0k0d3/4fd24c9d83a5b8ccb04f to your computer and use it in GitHub Desktop.
HackerRank Concatenate an array with itself
i=0
while read x
do
arr[$i]=$x
i=$i+1
done
arr=(${arr[@]} ${arr[@]} ${arr[@]})
echo ${arr[@]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment