Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def string_rev_if_4(input)
- return input.reverse if input.length < 4
- input
- end
- string_rev_if_4("he") # "eh"
- string_rev_if_4("hel") # "leh"
- string_rev_if_4("hell") # "hell"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement