Ad
  • Default User Avatar

    If you google the ASCII table it might make more sense but basically the characters 0-9 are grouped together on the ascii table. Meaning if you take the character of 0 ('0') and add 1 to it, you'll get the character '1' and its basically how this coder is converting int to char and then throws it into the string(which is an array of chars, c++ strings are bit fancier than that tho).

  • Default User Avatar

    Could someone explain how the line, "res[is] = '0' + digits[id++];" is working? I don't understand why the '0' is necessary. Thanks!

  • Default User Avatar

    I did something very similar. Only difference is I mapped all 4 of "T", "A", "C", and "G" to different characters before doing another 4 "replaceAll()"s. So this runs slightly faster than mine. Good job!