Daily coding problem: Find singles in array of doubles

preview_player
Показать описание
problem:
Given an array of integers in which two elements appear exactly once and all other elements appear exactly twice, find the two elements that appear only once. For example, given the array [2, 4, 6, 8, 10, 2, 6, 10], return 4 and 8. The order does not matter.

Me solving a daily coding problem, lmk if you liked it.

One side note is when I printed the sorted array I accidentally said it didn't sort the second array because they were the same, but that was wrong. The second didn't get printed because it was returned inside the if statement. Whoops, im so embarrassed. Lol
Рекомендации по теме
visit shbcf.ru