Solution for Flag, FrogJump, PermMissingElem and tapeEquilibrium tasks