This was plain retarded and a complete waste of time. I still can not understand why the interviewer would reject me. The question was incredibly straightforward. I was very clear with my answers. I had one hiccup when my indices were off by 1. But in the end, the interviewer said that the algorithm is perfect. It was as optimal as it can get. I ran it on a couple of test cases. They never judged me based on my personality, so I don't understand what else they were looking at. It was two college graduates who were more confused than I was. I think Snap really needs to reevaluate it's hiring process. I was looking forward to my next stage.