Update number_of_days.rb

This commit is contained in:
Vitor Oliveira 2021-08-22 14:20:55 -07:00 committed by GitHub
parent e804e6814c
commit 20a79f924b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,10 +15,11 @@
#
# Approach 1: Using Date.parse
# Approach 1: Using Ruby built-in Date.parse
# Time complexity: O(1)
# Space complexity: O(1)
#
require 'date'
def number_of_days(date1, date2)
@ -31,4 +32,4 @@ puts number_of_days("2019-06-29", "2019-06-30")
# => 1
puts number_of_days("2020-01-15", "2019-12-31")
# => 15
# => 15