HERE Technologies interview question

Some problems from leet code website.