Skip to content

Commit

Permalink
📦 NEW: Ruby Demo
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadawais committed Aug 22, 2018
1 parent 1a51c21 commit 0a414af
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions demo/ruby.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Let's do a Palindrome.
def palindrome?(string)
if string.length == 1 || string.length == 0
true
else
if string[0] == string[-1]
palindrome?(string[1..-2])
else
false
end
end
end

0 comments on commit 0a414af

Please sign in to comment.