Leetcode Simple Python Program Using Loops In Matlab