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