1360. Number of Days Between Two Dates Easy
1/**
2 * [1360] Number of Days Between Two Dates
3 *
4 * Write a program to count the number of days between two dates.
5 * The two dates are given as strings, their format is YYYY-MM-DD as shown in the examples.
6 *
7 * Example 1:
8 * Input: date1 = "2019-06-29", date2 = "2019-06-30"
9 * Output: 1
10 * Example 2:
11 * Input: date1 = "2020-01-15", date2 = "2019-12-31"
12 * Output: 15
13 *
14 * Constraints:
15 *
16 * The given dates are valid dates between the years 1971 and 2100.
17 *
18 */
19pub struct Solution {}
20
21// problem: https://leetcode.com/problems/number-of-days-between-two-dates/
22// discuss: https://leetcode.com/problems/number-of-days-between-two-dates/discuss/?currentPage=1&orderBy=most_votes&query=
23
24// submission codes start here
25
26impl Solution {
27 pub fn days_between_dates(date1: String, date2: String) -> i32 {
28 0
29 }
30}
31
32// submission codes end
33
34#[cfg(test)]
35mod tests {
36 use super::*;
37
38 #[test]
39 fn test_1360() {
40 }
41}
42
Back
© 2025 bowen.ge All Rights Reserved.