Last executed input: "+"


  • 0
    A

    When I run my program, it shows "Last executed input: "+"" which I don't understand what it means.

    class Solution {
    public:
        int myAtoi(string str) {
            if(str == "") return 0;
            int x = 0;
            try {
               x = std::stoi(str);
            }
            catch(std::out_of_range& e){
               if(str[0] == '-')
                  return INT_MIN;
               else
                  return INT_MAX;
            }
            return x;
         }
    };

  • 0
    P

    just input a "+", you should return 0.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.