Set .symmetric_difference() Operation

  • + 0 comments

    I'm curious is there an advantage to use this

    for (int i = 0; i < strlen(s); i++) {
     if (s[i] >= 'a' && s[i] <= 'z') {
      small[s[i] - 'a'] = 1;
       }
     else if (s[i] >= 'A' && s[i] <= 'Z') {
      big[s[i] - 'A'] = 1;
     }
    }
    

    vs

    for (int i = 0; i < strlen(s); i++) {
     if (tolower(s[i]) >= 'a' && s[i] <= 'z') {
      small[tolower(s[i]) - 'a'] = 1;
       }
    }