Page tree
Skip to end of metadata
Go to start of metadata
title
from typing import List


class Solution:
    def alienOrder(self, words: List[str]) -> str:
        adj_dict = self.get_adj_dict(words)
        self.find_edge(adj_dict)


    def get_adj_dict(self, words: List[str]) -> dict:
        """
        주어진 셋에서 중복되지 않는 문자를 뽑아냄.
        :param words:
        :return:
        """
        pass

    def find_edge(self, dict):
        """
        각 문자의 인접 글자를 저장함. adj list
        :param dict:
        :return:
        """
        pass
    def dfs(self, dict)->str:
        """
        dfs해서 순서 찾기
        :paam dict:
        :return:
        """
        pass


def test_alienOrder():
    sol = Solution()
    assert sol.alienOrder(['wrt', 'wrf', 'er', 'ett', 'rftt']) == 'wertf'
    assert sol.alienOrder(["z", "x"]) == "zx"
    assert sol.alienOrder(["z", "x", "z"]) == ""
   



  • No labels