法1:暴力 时间复杂度为On^2 vector<int> multiply(vector<int>& A) { // write code here vector<int> res; int len = A.size(); for(int i = 0; i < len; ++i){ int b = 1; for(in…
模拟题,感觉挺复杂的 class Solution { public: int myAtoi(string str) { int len = str.size(); int i = 0, flag = 1; long long base = 0; // 跳过前导空格 while (i < len && str[i] == ' …
感觉像是模拟题,法1,暴力遍历,时间复杂度应该是On class Solution { public: int get1(int x){ int sum = 0; while(x){ if(x % 10 == 1){ sum++; } x = x / 10; } return sum; } int NumberOf1Between1AndN_Sol…