Probability that the first sweet is orange = 6/n
Probability that, if the first was orange, the second is also orange = 5/(n-1) beacuse there are only 5 orange sweets left and there are only n-1 sweets left in total.
Hence overall probability that her two sweets are orange = (6/n)*(5/(n-1)) = 30/(n(n-1))
We are told this equals 1/3, so 30/(n(n-1)) = 1/3
Multiply both sides by 3n(n-1): 90 = n(n-1) or 90 = n^2 - n
Subtract 90 from both sides: n^2 - n - 90 = 0
This factors as (n-10)(n+9) = 0
Since we can't have a negative number of sweets, we must have n = 10 sweets