It was a good class today. I did a lot done, and now I am very very close to finishing String 1. I only had 4 problems left when I left class, but over the weekend I did one more so I have only three problems left.
The problem I will be showing you today is the one that I did at home, and it was more complicated than I expected it to be and it took me a while to finally get the logic straight.
Given two strings, append them together (known as "concatenation") and return the result. However, if the strings are different lengths, omit chars from the longer string so it is the same length as the shorter string. So "Hello" and "Hi" yield "loHi". The strings may be any length. minCat("Hello", "Hi") → "loHi" minCat("Hello", "java") → "ellojava" minCat("java", "Hello") → "javaello" |
Next class I will definitely finish String 1, and then continue to Array 1. |
No comments:
Post a Comment