from typing import List
from typing import OrderedDict


def headings(lines: List[str]):
    """Findings lines that are markdown headings 
    
    Args:
        lines (list): List with lines (strings)
        
    Returns:
        headings (dict): line number (key) and line (str)
    """
    heading_lines = OrderedDict({})
    is_block = False
    n = 0
    while n < len(lines):
        if lines[n].startswith('```'):
            is_block = not is_block

        if not is_block and lines[n].startswith('#'):
            heading_lines[n] = lines[n]
        n += 1
        
    return heading_lines