Ad
  • Default User Avatar

    increment_factor is not needed, you can just call factors[factor]++; always - if the key does not exist, map will add it with the value 0 and increase it to 1 as expected.