Skip to content

Commit 5556314

Browse files
authored
2025-02-27 v. 8.7.4: added "1641. Count Sorted Vowel Strings"
2 parents dc1c285 + db3affe commit 5556314

File tree

4 files changed

+23
-1
lines changed

4 files changed

+23
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,7 @@ Profile on LeetCode: [fartem](https://leetcode.com/fartem/).
707707
| 1557. Minimum Number of Vertices to Reach All Nodes | [Link](https://leetcode.com/problems/minimum-number-of-vertices-to-reach-all-nodes/) | [Link](./lib/medium/1557_minimum_number_of_vertices_to_reach_all_nodes.rb) | [Link](./test/medium/test_1557_minimum_number_of_vertices_to_reach_all_nodes.rb) |
708708
| 1609. Even Odd Tree | [Link](https://leetcode.com/problems/even-odd-tree/) | [Link](./lib/medium/1609_even_odd_tree.rb) | [Link](./test/medium/test_1609_even_odd_tree.rb) |
709709
| 1630. Arithmetic Subarrays | [Link](https://leetcode.com/problems/arithmetic-subarrays/) | [Link](./lib/medium/1630_arithmetic_subarrays.rb) | [Link](./test/medium/test_1630_arithmetic_subarrays.rb) |
710+
| 1641. Count Sorted Vowel Strings | [Link](https://leetcode.com/problems/count-sorted-vowel-strings/) | [Link](./lib/medium/1641_count_sorted_vowel_strings.rb) | [Link](./test/medium/test_1641_count_sorted_vowel_strings.rb) |
710711
| 2116. Check if a Parentheses String Can Be Valid | [Link](https://leetcode.com/problems/check-if-a-parentheses-string-can-be-valid/) | [Link](./lib/medium/2116_check_if_a_parentheses_string_can_be_valid.rb) | [Link](./test/medium/test_2116_check_if_a_parentheses_string_can_be_valid.rb) |
711712
| 2425. Bitwise XOR of All Pairings | [Link](https://leetcode.com/problems/bitwise-xor-of-all-pairings/) | [Link](./lib/medium/2425_bitwise_xor_of_all_pairings.rb) | [Link](./test/medium/test_2425_bitwise_xor_of_all_pairings.rb) |
712713
| 2429. Minimize XOR | [Link](https://leetcode.com/problems/minimize-xor/) | [Link](./lib/medium/2429_minimize_xor.rb) | [Link](./test/medium/test_2429_minimize_xor.rb) |

leetcode-ruby.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ require 'English'
55
::Gem::Specification.new do |s|
66
s.required_ruby_version = '>= 3.0'
77
s.name = 'leetcode-ruby'
8-
s.version = '8.7.3'
8+
s.version = '8.7.4'
99
s.license = 'MIT'
1010
s.files = ::Dir['lib/**/*.rb'] + %w[README.md]
1111
s.executable = 'leetcode-ruby'
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# frozen_string_literal: true
2+
3+
# https://leetcode.com/problems/count-sorted-vowel-strings/
4+
# @param {Integer} n
5+
# @return {Integer}
6+
def count_vowel_strings(n)
7+
(n + 4) * (n + 3) * (n + 2) * (n + 1) / 24
8+
end
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# frozen_string_literal: true
2+
3+
require_relative '../test_helper'
4+
require_relative '../../lib/medium/1641_count_sorted_vowel_strings'
5+
require 'minitest/autorun'
6+
7+
class CountSortedVowelStringsTest < ::Minitest::Test
8+
def test_default_one = assert_equal(5, count_vowel_strings(1))
9+
10+
def test_default_two = assert_equal(15, count_vowel_strings(2))
11+
12+
def test_default_three = assert_equal(66_045, count_vowel_strings(33))
13+
end

0 commit comments

Comments
 (0)