Vectorization Over Loops

Cephas le 11 Nov 2025
Dernière activité Réponse par Mohammad Aryayi le 12 Nov 2025

I realized that using vectorized logic instead of nested loops makes Cody problems run much faster and cleaner. Functions like any(), all(), and logical indexing can replace multiple for-loops easily !
Mohammad Aryayi
Mohammad Aryayi le 12 Nov 2025
Yes, it's true for all of the language like Matlab or Python. On the other hand, using prebuilt functions usually are more fast than writing them again, because they have been optimized.
But honestly in Cody that it's just for exercise, sometimes writing some lines of code is more cool than just search and find some non common funtions in Matlab!