On Tuesday, I will be giving my quarter presentation. I always feel as if the presentation makes it seem like I did nothing throughout the quarter, and that also it gets repetitive for people who have been in the class since last semester. I explain what CodingBat is, and how I use it, and relate it to the AP - but it's all been heard before by some of the people in our class. And also, it is quick to explain - and I feel like it doesn't really represent the work and the logic that needs to be used to solve these problems.
But, I will still try my best to explain it as well as possible, so that my classmates get a more thorough idea of what CodingBat is.
Here is today's rather complicated problem:
----------------------------------------------------------------------------------------------------------------------------------
We'll say that an element in an array is "alone" if there are values before and after it, and those values are different from it. Return a version of the given array where every instance of the given value which is alone is replaced by whichever value to its left or right is larger.
notAlone({1, 2, 3}, 2) → {1, 3, 3}
notAlone({1, 2, 3, 2, 5, 2}, 2) → {1, 3, 3, 5, 5, 2}
notAlone({3, 4}, 3) → {3, 4}
Looking forward to presenting next class and listening to what others have been working on. |
No comments:
Post a Comment