Question: I´ve been struggling with this:

![enter image description here](https://i.stack.imgur.com/gVzSf.png)

My table shows 3 records but when expanding there are like 100 columns. I used this code:

```
#"Expanded Data" = Table.ExpandTableColumn(#"Source", "Document", List.Union(List.Transform(#"Source"[Document]), each Table.ColumnNames(_))),

```

but it's not working. How can I expand simultaneously all columns? Also, inside those columns there are even more, for example I expand the first time end then those new columns have more records inside.

What could I do? Thanks in advance!

Answer: 
Well you need to modify your code as following as it is more optimised:

```

def twoStrings(s1, s2):
    UniqueChar_S1 = set(s1)
    UniqueChar_S2 = set(s2)

    for i in UniqueChar_S1:
        if i in UniqueChar_S2:
            return "YES"

    return "NO"

```
```
def two_strings(s1, s2):
    return "YES" if set(s1).intersection(set(s2)) else "NO"

def main():
    q = int(input("Numbers: "))
    for q_itr in range(q):
        s1 = input("String 1: ")
        s2 = input("String 2: ")

        result = two_strings(s1, s2)
        print(result)

if __name__ == "__main__":
    main()

```