3856. Trim Trailing Vowels Easy
1/**
2 * [3856] Trim Trailing Vowels
3 *
4 * You are given a string s that consists of lowercase English letters.
5 * Return the string obtained by removing all trailing vowels from s.
6 * The vowels consist of the characters 'a', 'e', 'i', 'o', and 'u'.
7 *
8 * <strong class="example">Example 1:
9 * <div class="example-block">
10 * Input: <span class="example-io">s = "idea"</span>
11 * Output: <span class="example-io">"id"</span>
12 * Explanation:
13 * Removing "id<u>ea</u>", we obtain the string "id".
14 * </div>
15 * <strong class="example">Example 2:
16 * <div class="example-block">
17 * Input: <span class="example-io">s = "day"</span>
18 * Output: <span class="example-io">"day"</span>
19 * Explanation:
20 * There are no trailing vowels in the string "day".
21 * </div>
22 * <strong class="example">Example 3:
23 * <div class="example-block">
24 * Input: <span class="example-io">s = "aeiou"</span>
25 * Output: <span class="example-io">""</span>
26 * Explanation:
27 * Removing "<u>aeiou</u>", we obtain the string "".
28 * </div>
29 *
30 * Constraints:
31 *
32 * 1 <= s.length <= 100
33 * s consists of only lowercase English letters.
34 *
35 */
36pub struct Solution {}
37
38// problem: https://leetcode.com/problems/trim-trailing-vowels/
39// discuss: https://leetcode.com/problems/trim-trailing-vowels/discuss/?currentPage=1&orderBy=most_votes&query=
40
41// submission codes start here
42
43impl Solution {
44 pub fn trim_trailing_vowels(s: String) -> String {
45 String::new()
46 }
47}
48
49// submission codes end
50
51#[cfg(test)]
52mod tests {
53 use super::*;
54
55 #[test]
56 fn test_3856() {
57 }
58}
59Back
© 2026 bowen.ge All Rights Reserved.