Leetcode
Here are my solutions to various LeetCode problems, showcasing my problem-solving approach and coding skills.
Two Sum
2024.12.21
Easy
Solved my first LeetCode problem, Two Sum! 🚀 Used a nested loop approach and working to reduce my runtime. Excited for more challenges ahead! 💪
function twoSum(nums, target) {
for (let i = 0; i < nums.length; i++) {
for (let j = i + 1; j < nums.length; j++) {
if (nums[i] + nums[j] === target) {
return [i, j];
}
}
}
return [];
}