Skip to content

Instantly share code, notes, and snippets.

@syafdia
Last active February 9, 2022 09:15
Show Gist options
  • Save syafdia/9597ccee36d320497202484e74a168d6 to your computer and use it in GitHub Desktop.
Save syafdia/9597ccee36d320497202484e74a168d6 to your computer and use it in GitHub Desktop.
words = ["B$u$i$ld", "$t$$h$e", "N$e$x$t", "E$$ra", "$$o$f$", "S$$of$t$wa$r$e", "De$$ve$l$op$me$n$t"]
i = words.size - 1
result = ''
while i >= 0
s = i == 0 ? '' : ' '
word = words[i]
result = result + word.gsub('$', '').upcase + s
i = i-1
end
puts result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment