Goldman sachs Interview Question

Sort a list of strings according to a given order of the alphabets.

For example, ["abcd","yyyy","zk"], order="yzxabcdefghijklmnopqrstuvw"

Output: ["yyyy","zk",abcd"]

Can we design a custom comparator to sort the list using collections.sort in java?

Comments (5)