Discussion 2: Leetcode!
Discussion 2: Thursday, May 28, 2026.
This discussion section works through Leetcode-style programming exercises in Rust.
Submit your work on Gradescope.
Part 1: Missing Number
Solve the Missing Number problem on Leetcode.
Hint: consider using a
HashMapor aHashSet!
Upload a screenshot of your submission getting accepted on Leetcode to Gradescope.
Part 2: Kth Largest Number
Solve the Kth Largest Element in an Array problem on Leetcode.
Consider using a BinaryHeap — a data structure that allows you to insert and remove elements by their relative order.
Here is an example of how to use it.
Upload a screenshot of your submission getting accepted on Leetcode to Gradescope.