Forum Discussion
- HimanshuTayalCommunity Hero
- akashreuben7New Contributor
Awesome this helps himanshu.
I have found another way to do it in a simple format.
def Z = ['a','b','c','d','e']
def result =[Z,Z,Z].combinations().findAll{x,y,z -> x<y&y<z}
def result2 = [Z,Z].combinations().findAll{x,y -> x<y}
def finalresult = result + result2
log.info finalresultresult :[[a, b, c], [a, b, d], [a, c, d], [b, c, d], [a, b, e], [a, c, e], [b, c, e], [a, d, e], [b, d, e], [c, d, e], [a, b], [a, c], [b, c], [a, d], [b, d], [c, d], [a, e], [b, e], [c, e], [d, e]]
- HimanshuTayalCommunity Hero
Related Content
- 4 years ago
- 6 years ago
Recent Discussions
- 2 days ago