Https://practice.geeksforgeeks.org/problems/alien-dictionary/1
Consider the case: word1=“abc” and word2=“abcd” then, there should not be any edge. But u are creating an edge in ur code. Try to correct this.
sir still not getting answer
Store in form of number instead of characters because if two different component have edge between a and b ur code will run only in one component.