add ruby solution for max difference