mirror of
https://github.com/TheAlgorithms/Ruby
synced 2024-12-26 21:58:56 +01:00
Move algorithsm to appropriate folder
This commit is contained in:
parent
7d1f6659ff
commit
3270667f8e
1 changed files with 3 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
|||
#
|
||||
# Given a string s, remove the vowels 'a', 'e', 'i', 'o', and 'u'
|
||||
# from it, and return the new string.
|
||||
#
|
||||
# Example 1:
|
||||
# Input: s = "leetcodeisacommunityforcoders"
|
||||
# Output: "ltcdscmmntyfrcdrs"
|
||||
|
@ -18,6 +19,7 @@
|
|||
#
|
||||
# Time Complexity: O(n)
|
||||
#
|
||||
|
||||
def remove_vowels(s)
|
||||
result_array = []
|
||||
s.downcase!
|
||||
|
@ -57,7 +59,7 @@ s = 'aeiou'
|
|||
puts(remove_vowels(s))
|
||||
# => ""
|
||||
|
||||
#
|
||||
#
|
||||
# Approach 3: Using Ruby .delete() method
|
||||
#
|
||||
# Time Complexity: O(n)
|
Loading…
Reference in a new issue