Is it possible to do this equation in O(1) space and O(n) time? Tried a lot, but couldn't solve this problem. On top of that, there is no solution in discussions with O(1) space and O(n) time. Please share your answer to this problem!!!