Friday, February 13, 2015

Friday, February 13th

Today was a half day, so only about 45 minutes in class. Yet surprisingly, I still managed to get a lot finished. I'm really flying through the Arrays.. in simply 45 minutes I got 7 of them done ! I didn't feel like they got harder at all except the last three which I still need to complete two of. I did the first 6 problems easily, and then on the last one I did I needed some help from Mr. Daly and after looking at the last two at home also I will be asking Mr. Daly for help when I get back to school.

Here is the first problem of the last three, the most complicated one for now:


We'll say that a 1 immediately followed by a 3 in an array is an "unlucky" 1. Return true if the given array contains an unlucky 1 in the first 2 or last 2 positions in the array. 

unlucky1({1, 3, 4, 5}) → true
unlucky1({2, 1, 3, 4, 5}) → true
unlucky1({1, 1, 1}) → false



Next class I'll finish arrays for sure. Mr. Daly said he would talk to me about loops also.

No comments:

Post a Comment