https://alandroidnet.com/dev/Halgorithm Solution