Skip to content

Commit e11a57f

Browse files
committed
fix rust imports
1 parent 00ddf6b commit e11a57f

20 files changed

Lines changed: 0 additions & 108 deletions

articles/binary-search-tree-iterator.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -351,9 +351,6 @@ class BSTIterator {
351351
```
352352

353353
```rust
354-
use std::rc::Rc;
355-
use std::cell::RefCell;
356-
357354
struct BSTIterator {
358355
arr: Vec<i32>,
359356
itr: usize,
@@ -721,9 +718,6 @@ class BSTIterator {
721718
```
722719

723720
```rust
724-
use std::rc::Rc;
725-
use std::cell::RefCell;
726-
727721
struct BSTIterator {
728722
arr: Vec<i32>,
729723
itr: usize,
@@ -1070,9 +1064,6 @@ class BSTIterator {
10701064
```
10711065

10721066
```rust
1073-
use std::rc::Rc;
1074-
use std::cell::RefCell;
1075-
10761067
struct BSTIterator {
10771068
stack: Vec<Rc<RefCell<TreeNode>>>,
10781069
}
@@ -1396,9 +1387,6 @@ class BSTIterator {
13961387
```
13971388

13981389
```rust
1399-
use std::rc::Rc;
1400-
use std::cell::RefCell;
1401-
14021390
struct BSTIterator {
14031391
cur: Option<Rc<RefCell<TreeNode>>>,
14041392
stack: Vec<Rc<RefCell<TreeNode>>>,

articles/closest-binary-search-tree-value.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,6 @@ class Solution {
177177
```
178178

179179
```rust
180-
use std::cell::RefCell;
181-
use std::rc::Rc;
182-
183180
impl Solution {
184181
pub fn closest_value(root: Option<Rc<RefCell<TreeNode>>>, target: f64) -> i32 {
185182
let mut nums = Vec::new();
@@ -440,9 +437,6 @@ class Solution {
440437
```
441438

442439
```rust
443-
use std::cell::RefCell;
444-
use std::rc::Rc;
445-
446440
impl Solution {
447441
pub fn closest_value(root: Option<Rc<RefCell<TreeNode>>>, target: f64) -> i32 {
448442
let mut stack: Vec<Rc<RefCell<TreeNode>>> = Vec::new();
@@ -656,9 +650,6 @@ class Solution {
656650
```
657651

658652
```rust
659-
use std::cell::RefCell;
660-
use std::rc::Rc;
661-
662653
impl Solution {
663654
pub fn closest_value(root: Option<Rc<RefCell<TreeNode>>>, target: f64) -> i32 {
664655
let mut curr = root;

articles/constrained-subsequence-sum.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,8 +1401,6 @@ struct Heap<T> {
14011401
```
14021402

14031403
```rust
1404-
use std::collections::BinaryHeap;
1405-
14061404
impl Solution {
14071405
pub fn constrained_subset_sum(nums: Vec<i32>, k: i32) -> i32 {
14081406
let k = k as usize;

articles/construct-string-from-binary-tree.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,6 @@ class Solution {
318318
```
319319

320320
```rust
321-
use std::cell::RefCell;
322-
use std::rc::Rc;
323321
impl Solution {
324322
pub fn tree2str(root: Option<Rc<RefCell<TreeNode>>>) -> String {
325323
match root {

articles/count-prefix-and-suffix-pairs-i.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -766,8 +766,6 @@ class Solution {
766766
```
767767

768768
```rust
769-
use std::collections::HashMap;
770-
771769
struct TrieNode {
772770
children: HashMap<(u8, u8), TrieNode>,
773771
count: i32,

articles/design-search-autocomplete-system.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -550,8 +550,6 @@ class AutocompleteSystem {
550550
```
551551

552552
```rust
553-
use std::collections::HashMap;
554-
555553
struct TrieNode {
556554
children: HashMap<char, usize>,
557555
sentences: HashMap<String, i32>,
@@ -1262,8 +1260,6 @@ class AutocompleteSystem {
12621260
```
12631261

12641262
```rust
1265-
use std::collections::{BinaryHeap, HashMap};
1266-
12671263
struct TrieNode {
12681264
children: HashMap<char, usize>,
12691265
sentences: HashMap<String, i32>,

articles/encode-n-ary-tree-to-binary-tree.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -778,8 +778,6 @@ class Codec {
778778
// Uses TreeNode with Option<Rc<RefCell<TreeNode>>>
779779
// and a custom NaryNode for the N-ary tree.
780780

781-
use std::collections::VecDeque;
782-
783781
struct Codec;
784782

785783
impl Codec {

articles/final-array-state-after-k-multiplication-operations-i.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,8 +445,6 @@ class Solution {
445445
```
446446

447447
```rust
448-
use std::cmp::Reverse;
449-
450448
impl Solution {
451449
pub fn get_final_state(nums: Vec<i32>, k: i32, multiplier: i32) -> Vec<i32> {
452450
let mut res = nums.clone();

articles/find-bottom-left-tree-value.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,6 @@ class Solution {
258258

259259

260260
```rust
261-
use std::cell::RefCell;
262-
use std::rc::Rc;
263261
impl Solution {
264262
pub fn find_bottom_left_value(root: Option<Rc<RefCell<TreeNode>>>) -> i32 {
265263
let mut q = VecDeque::new();
@@ -588,8 +586,6 @@ class Solution {
588586

589587

590588
```rust
591-
use std::cell::RefCell;
592-
use std::rc::Rc;
593589
impl Solution {
594590
pub fn find_bottom_left_value(root: Option<Rc<RefCell<TreeNode>>>) -> i32 {
595591
let mut max_depth = -1;
@@ -953,8 +949,6 @@ class Solution {
953949

954950

955951
```rust
956-
use std::cell::RefCell;
957-
use std::rc::Rc;
958952
impl Solution {
959953
pub fn find_bottom_left_value(root: Option<Rc<RefCell<TreeNode>>>) -> i32 {
960954
let mut res = root.as_ref().unwrap().borrow().val;
@@ -1408,8 +1402,6 @@ class Solution {
14081402

14091403

14101404
```rust
1411-
use std::cell::RefCell;
1412-
use std::rc::Rc;
14131405
impl Solution {
14141406
pub fn find_bottom_left_value(root: Option<Rc<RefCell<TreeNode>>>) -> i32 {
14151407
let mut res = root.as_ref().unwrap().borrow().val;

articles/find-duplicate-subtrees.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -419,9 +419,6 @@ class Solution {
419419
// comparison of tree node pointers, which doesn't directly
420420
// translate to Rust's Rc<RefCell<TreeNode>>. We use index-based
421421
// tracking instead.
422-
use std::rc::Rc;
423-
use std::cell::RefCell;
424-
425422
impl Solution {
426423
pub fn find_duplicate_subtrees(
427424
root: Option<Rc<RefCell<TreeNode>>>,
@@ -750,9 +747,6 @@ class Solution {
750747
```
751748

752749
```rust
753-
use std::rc::Rc;
754-
use std::cell::RefCell;
755-
756750
impl Solution {
757751
pub fn find_duplicate_subtrees(
758752
root: Option<Rc<RefCell<TreeNode>>>,
@@ -1090,9 +1084,6 @@ class Solution {
10901084
```
10911085

10921086
```rust
1093-
use std::rc::Rc;
1094-
use std::cell::RefCell;
1095-
10961087
impl Solution {
10971088
pub fn find_duplicate_subtrees(
10981089
root: Option<Rc<RefCell<TreeNode>>>,

0 commit comments

Comments
 (0)