Description
This is a collection page for my LeetCode solutions.
I created this because GitHub’s landing page lacks a "pinning" option (for all my repos),
and I wanted a place to organize my code.
I mainly solve LeetCode problems for practice and to learn complex algorithms, rather than for
job interviews.
Choose a LeetCode:
LeetCode 1.
Two Sum ➕
Programing langeuge: Rust 🦀
My sulotions ☺️
🧠 How I solved the problem
I implemented a brute-force solution using nested loops.
To avoid the "double-counting" bug (using the same element twice),
the inner loop starts from the next element relative to the outer loop.
This ensures that we only compare distinct pairs and find the target sum
without using any element more than once.
LeetCode 2.
Add Two Numbers x ➕ ⅹ
Programing langeuge: Rust 🦀
My sulotions ☺️
🧠 How I solved the problem
I reversed both input lists, then iterated through the elements and
converted them to strings. After concatenating them, I parsed the final
string back into an i32 to get the full number.
I did this for both lists, added the two numbers together,
and finally converted the sum back to a reversed list of characters.
LeetCode 4.
Median of Two Sorted Arrays 🖖
Programing langeuge: Rust 🦀
My sulotions ☺️
🧠 How I solved the problem
First, I concatenated and sorted the given lists.
Then, I implemented the following logic: if the combined list length is even,
I split it in the middle and calculate the average of the two central elements.
If the length is odd, I simply return the middle element.
LeetCode Test
Test 🧪
Programing langeuge: None 😶🌫️
My sulotions ☺️
🧠 How I solved the problem
Lorem Ipsum