Automatically sync your successful LeetCode submissions to GitHub. Includes AI-powered explanations and complexity analysis.
# Time: O(n) | Space: O(n)
class Solution:
def twoSum(self, nums, target):
prevMap = {} # val : index
for i, n in enumerate(nums):
diff = target - n
if diff in prevMap:
return [prevMap[diff], i]
prevMap[n] = i
return []
Forget manual uploads. We detect your successful submissions and push them to GitHub instantly.
Get automatic time & space complexity analysis and detailed explanations added to your code.
Supports Python, Java, C++, JavaScript, and every other language LeetCode supports.
First, download the source code and load it into your browser.
chrome://extensions.
You need a specific repository and a token to allow the extension to push code.
leetcode.repo scope (Full control of private
repositories).
Connect the extension to your GitHub account.
The fun part! Just solve problems.
Go to any LeetCode problem, submit a solution, and once it's accepted, check your GitHub repo. It will be there automagically.