The most common cause of dark spots
under nails is trauma. If you have dark spots
under two nails, that would point toward injury, not melanoma. If your doctor is concerned about melanoma, obviously nail biopsy is required; on the other hand, observation to see whether the dark spot "grows out"--as it would after injury--is another possible approach. I would, however, have to defer to the doctor who examined you in person.