Skip to content

Commit c4cbe71

Browse files
committed
2023-12-18 v. 3.7.6: added "1832. Check if the Sentence Is Pangram"
1 parent 000fb65 commit c4cbe71

File tree

4 files changed

+24
-1
lines changed

4 files changed

+24
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,3 +322,4 @@ Profile on LeetCode: [fartem](https://leetcode.com/fartem/).
322322
| 1816. Truncate Sentence | [Link](https://leetcode.com/problems/truncate-sentence/) | [Link](./lib/easy/1816_truncate_sentence.rb) |
323323
| 1822. Sign of the Product of an Array | [Link](https://leetcode.com/problems/sign-of-the-product-of-an-array/) | [Link](./lib/easy/1822_sign_of_the_product_of_an_array.rb) |
324324
| 1827. Minimum Operations to Make the Array Increasing | [Link](https://leetcode.com/problems/minimum-operations-to-make-the-array-increasing/) | [Link](./lib/easy/1827_minimum_operations_to_make_the_array_increasing.rb) |
325+
| 1832. Check if the Sentence Is Pangram | [Link](https://leetcode.com/problems/check-if-the-sentence-is-pangram/) | [Link](./lib/easy/1832_check_if_the_sentence_is_pangram.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 = '3.7.5'
8+
s.version = '3.7.6'
99
s.license = 'MIT'
1010
s.files = ::Dir['lib/**/*.rb'] + %w[bin/leetcode-ruby README.md LICENSE]
1111
s.executable = 'leetcode-ruby'
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# frozen_string_literal: true
2+
3+
require 'set'
4+
5+
# https://leetcode.com/problems/check-if-the-sentence-is-pangram/
6+
# @param {String} sentence
7+
# @return {Boolean}
8+
def check_if_pangram(sentence)
9+
sentence.split('').to_set.length == 26
10+
end
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# frozen_string_literal: true
2+
3+
require_relative '../test_helper'
4+
require_relative '../../lib/easy/1832_check_if_the_sentence_is_pangram'
5+
require 'minitest/autorun'
6+
7+
class CheckIfTheSentenceIsPangramTest < ::Minitest::Test
8+
def test_default
9+
assert(check_if_pangram('thequickbrownfoxjumpsoverthelazydog'))
10+
assert(!check_if_pangram('leetcode'))
11+
end
12+
end

0 commit comments

Comments
 (0)