algorithm done, does not pass kattis