Contributing to my own repo

One comment line, then just write the code.

Nothing on this site is written twice. Every page is parsed out of the solution files at build time, so a new problem is a header comment and a solution — no front-matter, no index to update, no separate write-up to keep in sync.

The format

Paste this above your solution and change the parts that differ.

####### ARRAYS AND HASHING #######

# 49. Group Anagrams (https://leetcode.com/problems/group-anagrams/description/) - Medium [sorted-key]
class Solution:
    '''
    Sort every word into a canonical key, then bucket words by that key.

    Time Complexity: O(n * k log k)
    Space Complexity: O(n * k)
    Pitfalls: dict.values() returns a view, not a list.
    '''
    def groupAnagrams(self, strs: List[str]) -> List[List[str]]:
        ...

Line by line

# //
Comment marker for the file you are in.
49.
LeetCode number. Leave it out for HackerRank challenges.
Group Anagrams
Title, exactly as the site spells it.
( … )
Canonical problem URL, in parentheses.
- Medium
Difficulty: Easy, Medium or Hard, after a hyphen.
[sorted-key]
Optional approach tag. See below.

The ####### SECTION ####### banner above a block sets the category for everything under it. Inside the docstring, Time Complexity:,Space Complexity: and Pitfalls: are pulled out and rendered as their own elements; whatever prose is left becomes the explanation. All of it is optional — a bare header line is enough.

Grouping one approach across languages

Give the same approach the same [tag] in every language — here inpython.py and java.java — and the two blocks merge into one solution with language tabs. Untagged blocks each become their own numbered solution, so tagging is an upgrade, never a requirement.

# 49. Group Anagrams (...) - Medium [sorted-key]
// 49. Group Anagrams (...) - Medium [sorted-key]

Open the file

Straight into the browser editor — commit from there and the site rebuilds.