This repository contains my solutions to LeetCode problems in Python, JavaScript, and C.
The purpose is to practice Data Structures & Algorithms, improve problem-solving skills, and keep track of progress.
- Problems are organized by topic (Arrays, Strings, DP, etc.).
- File names follow the problem title in snake_case.
- Each file starts with the problem link and a short explanation.
Problem: Two Sum
# two_sum.py
# https://leetcode.com/problems/two-sum/
def twoSum(nums, target):
mp = {}
for i, num in enumerate(nums):
if target - num in mp:
return [mp[target - num], i]
mp[num] = i