File tree 2 files changed +23
-10
lines changed
2 files changed +23
-10
lines changed Original file line number Diff line number Diff line change @@ -6,3 +6,9 @@ edition = "2021"
6
6
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7
7
8
8
[dependencies ]
9
+
10
+ [profile .dev ]
11
+ debug = true
12
+
13
+ [profile .release ]
14
+ debug = false
Original file line number Diff line number Diff line change 1
- mod easy;
1
+ mod medium;
2
+
3
+ use medium:: reorder_list:: ListNode ;
2
4
3
5
fn main ( ) {
6
+ // Reorder List - Medium
7
+ let mut head = Some ( Box :: new (
8
+ ListNode :: new ( 1 ) . add_next (
9
+ ListNode :: new ( 2 )
10
+ . add_next ( ListNode :: new ( 3 ) . add_next ( ListNode :: new ( 4 ) . add_next ( ListNode :: new ( 5 ) ) ) ) ,
11
+ ) ,
12
+ ) ) ;
4
13
5
- // Roman to Interger
6
- let s = String :: from ( "III" ) ;
7
- let result = easy:: roman_to_integer:: roman_to_int ( s) ;
8
- println ! ( "result: {}" , result) ;
14
+ medium:: reorder_list:: reorder_list ( & mut head) ;
9
15
10
- // Longest Common Prefix
11
- let strs = vec ! [ String :: from( "flower" ) , String :: from( "flow" ) , String :: from( "flight" ) ] ;
12
- let result = easy:: longest_common_prefix:: longest_common_prefix ( strs) ;
13
- println ! ( "result: {}" , result) ;
14
-
16
+ // Print elements of the list
17
+ let mut curr = head;
18
+ while let Some ( node) = curr {
19
+ println ! ( "{}" , node. val) ;
20
+ curr = node. next ;
21
+ }
15
22
}
You can’t perform that action at this time.
0 commit comments