-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pub mod add_two_numbers; | ||
pub mod two_sum; | ||
|
||
#[allow(dead_code)] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
use super::{Difficulty, Problem, Topic}; | ||
|
||
pub struct AddTwoNumbers; | ||
|
||
impl Problem for AddTwoNumbers { | ||
fn id(&self) -> usize { | ||
2 | ||
} | ||
fn difficulty(&self) -> Difficulty { | ||
Difficulty::Medium | ||
} | ||
fn topic(&self) -> Topic { | ||
Topic::Algorithms | ||
} | ||
fn title(&self) -> String { | ||
"Add Two Numbers".into() | ||
} | ||
fn description(&self) -> String { | ||
r#"You are given two non-empty linked lists representing two non-negative integers. | ||
The digits are stored in reverse order, and each of their nodes contains a single digit. | ||
Add the two numbers and return the sum as a linked list. | ||
You may assume the two numbers do not contain any leading zero, except the number 0 itself."# | ||
.into() | ||
} | ||
fn labels(&self) -> Vec<String> { | ||
["link list".into()].into() | ||
} | ||
} |