A little background: was asked to answer the question on a technical interview, couldn't, and now I want to improve but can't find the logic to answer.
## CASE 1 ##
Given Input:
const profiles = ["Bill", "Steve", "Zuck"]
const skills =
[["Digital Marketing","SEO","UI/UX"],
["Accounting","Digital Marketing","Employer Branding"],
["Accounting","UI/UX"]]
Expected Output:
[[["Accounting"],["Steve","Zuck"]],
[["Digital Marketing"],["Bill","Steve"]],
[["Employer Branding"],["Steve"]],
[["SEO"],["Bill"]],
[["UI/UX"],["Bill","Zuck"]]]
## CASE 2 ##
Given Input:
const profiles= ["First", "Fourth", "Second", "Third"]
const skills =
[["One","Three","Two"],
["One","One three","One two"],
["One two","One two three","Two"],
["One","One three","One two","One two three","Three","Two"]]
Expected Output:
[[["One"],["First","Fourth","Third"]],
[["One three"],["Fourth","Third"]],
[["One two"],["Fourth","Second","Third"]],
[["One two three"],["Second","Third"]],
[["Three"],["First","Third"]],
[["Two"],["First","Second","Third"]]]
Thank you very much!