Leetcode's two sum problem's solution in rust

Kindly review the code the hardway , to optimize and make it efficient.
Stackoverflow link of my code

https://codereview.stackexchange.com/q/263572/238784

Create a hashmap of target - Vec. Then, instead of iterating through the Vec in the inner loop, just lookup in the hashMap and see if it's Some vs None.

2 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.