[2019][ruby][4.x]

sorbet
Alpha Chen 5 years ago
parent 4bb34be4a6
commit a3d275c27d

@ -0,0 +1,5 @@
puts (236491..713787).map(&:to_s).count {|password|
matching_digits = password.scan(/(.)\1/)
!matching_digits.empty? && matching_digits.flatten.any? {|d| !password.include?(d * 3) } && password.chars.each_cons(2).all? {|a,b| a <= b }
}
Loading…
Cancel
Save