Write a code to find the duplicate words in a string.
input string = "Big black bug bit a big black dog on his big black nose"
output:
Duplicate words in a given string : big black
Discussion posts and replies are publicly visible
a!localVariables( local!string: "Big black bug bit a big black dog on his big black nose", local!array: split(local!string," "), local!uniqueItems: union(local!array,local!array), a!forEach( items: local!uniqueItems, expression: if( count(wherecontains(fv!item,local!array))>1, fv!item, {} ) ) )