Bloomberg Interview Question

2 pointers leetcode question about valid triangle