Back to Browse

Rust Programming Exercises: Find All Duplicates in an Array

2.7K views
May 6, 2022
10:22

In this video we will be implementing the solution to the leet code problem Find All Duplicates in an Array in Rust. We will make use of the Entry API from a HashMap, HashSets, and the Vector in Rust. We will iterate over our values and learn how to compare each of the algorithms based on big-O notation. We also make use of the collect and iter functions to convert HashSets back into Vector for our results and make use of test functions to test our code. ↠ References: Find All Duplicates Problem: https://leetcode.com/problems/find-all-duplicates-in-an-array/ Vec: https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html#capacity-and-reallocation HashMap: https://doc.rust-lang.org/stable/std/collections/struct.HashMap.html#method.entry HashSet: https://doc.rust-lang.org/stable/std/collections/struct.HashSet.html ↠ Dotfiles: https://github.com/nyxtom/dotfiles ↠ Twitter: @nyxtom https://twitter.com/nyxtom ↠ Channel: https://www.youtube.com/c/nyxtom Cheers! 🍻 🦀 #rust #rustlang #rustprogramming #exercises #leetcode #programming

Download

1 formats

Video Formats

360pmp418.7 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

Rust Programming Exercises: Find All Duplicates in an Array | NatokHD