Snipp
Sign InSign Up

Discover Public Snippets

Browse and explore code shared by the community

6 snippets to explore

Test PUB

Public
python
def twoSum(nums, target):
    seen = {}
    for i, num in enumerate(nums):
        if target - num in seen:
            return [seen[target - num], i]
        seen[num] = i
v133/8/2026

pair programming

Public
python
def decodeString(s: str) -> str:
    stack = []
    current_num = 0
    current_str = ""

    for char in s:
        if char.isdigit():
            current_num = current_num * 10 + int(char)

        elif char == "[":
            stack.append([current_num, current_str])
            current_num = 0
            current_str = 0
        
        elif char == "]":
            prev_mult, prev_str = stack.pop()

            current_str = prev_str + (prev_mult * current_str)
        
        else:
            current_str += char

    return current_str
v13/1/2026

pair programming

Public
python
hello = 4
test = 4
v22/21/2026

learn stack

Public
python
var = 67
v12/12/2026

test

Public
python
print("can you see me!")
jijiji = 9
v22/12/2026

test

Public
python
print("can you see me!")
v12/12/2026