@ValeryUtukin

LeetCode doesn't accept it. And in IDE it works wrong. Too complicated task imho.