Ad
  • Custom User Avatar

    This solution is not entirely correct. It isn't considering the associativity of operations at all. And it should, because it is explicitly stated in the instructions of the problem that '^' is right-associative while the rest of operations are left-associative. The importance of this distinction can be seen in one of the examples provided, also in the instructions. "1^2^3" should return "123^^", while "1+2+3" should return "12+3+". This solution is not treating adequately the former (returns "12^3^").

    It appears there isn't any testcases with two consecutives ^. This should be fixed.

  • Custom User Avatar
  • Custom User Avatar

    one of the fastest solution