3 ms·You could make this O(n) with some memory trade offs...by Shenglong 15y agoYou could make this O(n) with some memory trade offs...