I did a set similar to yourself here but since the array size is limited to 500 it is faster to use an array with 0(n) time to do the .contains rather than a set since the overheads are so bad. This might be different for the language you are using but still might be important to know.
Wow! Bro , you're great! , keep going + i wish you find the job you want
Thanks bro! You too dude! Remember diligently putting in effort over a long term is much better for your emotional health than cramming !
I did a set similar to yourself here but since the array size is limited to 500 it is faster to use an array with 0(n) time to do the .contains rather than a set since the overheads are so bad. This might be different for the language you are using but still might be important to know.