Bloomberg interview question

2 pointers leetcode question about valid triangle