File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change
1
+ # frozen_string_literal: true
2
+
3
+ require 'find'
4
+
5
+ module LCSC
6
+ # Solutions counter.
7
+ class LCSCCounter
8
+ # @param {String} path
9
+ def initialize
10
+ @path = './'
11
+ end
12
+
13
+ # @return {Integer}
14
+ def count
15
+ dir_sub = "#{ @path } /lib"
16
+
17
+ easy = find_for_dir ( "#{ dir_sub } /easy" )
18
+ medium = find_for_dir ( "#{ dir_sub } /medium" )
19
+
20
+ easy + medium
21
+ end
22
+
23
+ private
24
+
25
+ def find_for_dir ( dir )
26
+ ::Find . find ( dir ) . count { |file | ::File . file? ( file ) }
27
+ end
28
+ end
29
+ end
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ require 'English'
5
5
::Gem ::Specification . new do |s |
6
6
s . required_ruby_version = '>= 3.0'
7
7
s . name = 'leetcode-ruby'
8
- s . version = '6.5.9'
8
+ s . version = '6.5.9.1 '
9
9
s . license = 'MIT'
10
10
s . files = ::Dir [ 'lib/**/*.rb' ] + %w[ README.md ]
11
11
s . executable = 'leetcode-ruby'
You can’t perform that action at this time.
0 commit comments