Graded lexicographic order (grlex order for short) is a way of ordering words that:
For example, in grlex order:
Given an array of words, return that array in grlex order.
makeGrlex(["small", "big"]) ➞ ["big", "small"]
makeGrlex(["cat", "ran", "for", "the", "rat"]) ➞ ["cat", "for", "ran", "rat", "the"]
makeGrlex(["this", "is", "a", "small", "test"]) ➞ ["a", "is", "test", "this", "small"]
N/A