Skip to content

Commit

Permalink
Sync LeetCode submission - Can Make Arithmetic Progression From Seque…
Browse files Browse the repository at this point in the history
…nce (rust)
  • Loading branch information
hucancode committed Nov 23, 2023
1 parent 16a90c6 commit ebfe278
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ impl Solution {
}
let mut vis = vec![false;n as usize];
arr.iter()
.map(|x| ((x-min)/d) as usize)
.map(|x| x-min)
.filter(|x| x%d == 0)
.map(|x| (x/d) as usize)
.for_each(|x| vis[x] = true);
vis.iter().all(|&x| x)
}
Expand Down

0 comments on commit ebfe278

Please sign in to comment.