Can somebody help me where i went wrong?
(I know binary search is an option and i will implement that as well)
I was looking at @tmwilliamlin solution for the same question.
Is there a difference in speed between array and vector?
Yes there is, array is fixed size thus the compiler can make it much faster.
You’re creating a copy of each element of each element of
Oh, wait - each such vector is tiny (just 3 elements) so it’s probably not that - although you should be doing it anyway
Hmmm … actually, the speed up is quite significant, so definitely try it, after all
this actually worked
wow thanks a lot @ssjgz
i used to think this only sped up when i am accessing an array during function passing
@tmwilliamlin Well yeah my solution passed with almost same time with the method below but will learn this method as well XD
yeah you are correct