From 3270667f8edc81b2d08d2058a4d35febb377f6e6 Mon Sep 17 00:00:00 2001 From: Vitor Oliveira Date: Mon, 29 Mar 2021 14:52:06 -0700 Subject: [PATCH] Move algorithsm to appropriate folder --- data_structures/arrays/{ => strings}/remove_vowels.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) rename data_structures/arrays/{ => strings}/remove_vowels.rb (99%) diff --git a/data_structures/arrays/remove_vowels.rb b/data_structures/arrays/strings/remove_vowels.rb similarity index 99% rename from data_structures/arrays/remove_vowels.rb rename to data_structures/arrays/strings/remove_vowels.rb index 5fa39fc..30d3042 100644 --- a/data_structures/arrays/remove_vowels.rb +++ b/data_structures/arrays/strings/remove_vowels.rb @@ -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)