Skip to content

Instantly share code, notes, and snippets.

@smartwatermelon
Created October 10, 2022 22:02
Show Gist options
  • Save smartwatermelon/3ea870a8f06fa80c60f4f3b525f95bc3 to your computer and use it in GitHub Desktop.
Save smartwatermelon/3ea870a8f06fa80c60f4f3b525f95bc3 to your computer and use it in GitHub Desktop.
@cassidoo's interview question from October 10, 2022
MONTASIO:~ andrewrich$ N=3
MONTASIO:~ andrewrich$ STR="never gonna give you up"
MONTASIO:~ andrewrich$ for word in $STR; do echo "${word:0:$N}"; done
nev
gon
giv
you
up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment