Question: I have created a nodejs express service. When you make it live by running something like `nodemon server.js` then it runs on `your-ip:port-you-listened-on` (`app.listen(3000);`)

**How do I get me nodejs service to run on a host name though?** I need this for my certificate to work. For example, I want it to run on `https://test.mydomain.com`, so a call would be something like `https://test.mydomain.com/login`

Answer: 
IIUC then you can use `itertools.product` to get product of two different lists and then perform set intersection to find the common words

```
from itertools import product
x=['casa','lo','pre','computer']
y=['music','sun','ve','sident','house']
dic=['sunday','love','president','house','computer']
set(list(map(''.join, list(product(x, y)))) + x + y) & set(dic)

```

OUTPUT:

```
{'computer', 'house', 'love', 'president'}

```

If the expected output should not include `house` from second list then do not append list `y` in the final concatenated list

```
set(list(map(''.join, list(product(x, y)))) + x) & set(dic)

```

OUTPUT

```
{'computer', 'love', 'president'}

```
Here's a straightforward version with nothing fancy. Others have suggested options that are likely more efficient; however, I think this solution captures your desired solution better than some (e.g., by checking all variations of concatenations).

You will want to use sets if you're doing a lot of lookups.

```
x = ['casa','lo','pre','computer']
y = ['music','sun','ve','sident','house']
dic = set(['sunday','love','president','house','computer'])
in_dic = set()
for str in y:
    if str in dic:
        in_dic.add(str)
for str1 in x:
    if str1 in dic:
        in_dic.add(str1)
    for str2 in y:
        str3 = str1 + str2
        str4 = str2 + str1
        if str3 in dic:
            in_dic.add(str3)
        if str4 in dic:
            in_dic.add(str4)

print(list(in_dic))
['president', 'love', 'computer', 'house']

```