Hello friends!
I hope you had a great week. I personally had a cold this week, but it was a good way to kind of reset myself after a couple days of it. Let's get reading.
Â
Web links of the week
Finally understand Redux by building your own Store
Getting started with PWA using Vue
Font-display
Calendar with CSS Grid
Â
Something that interested me this week
I saw a cool video about
how rubber bands are made this week. It was a cool video, but it started to make me think about more than just rubber bands. Everything we have ever touched was made by someone. I'm typing this while under a blanket that was designed by someone, I'm typing into an app that was built by someone, I have a show playing in the background that was made by hundreds of different people. I know it's probably silly to think about things like that, but it definitely helps put ideas (especially product-oriented ones) into perspective.
Â
Interview question of the week
Last time, I had you sort a stack of integers from least to greatest using another stack.
Here's a solution to the problem:
public static Stack<Integer> sortstack(Stack<Integer> input) {
Stack<Integer> tmpStack = new Stack<Integer>();
while(!input.isEmpty()) {
int tmp = input.pop();
while(!tmpStack.isEmpty() && tmpStack.peek() > tmp) {
input.push(tmpStack.pop());
}
tmpStack.push(tmp);
}
return tmpStack;
}
Here's this week's question!
Write a function that prints a Christmas (or just pine) tree with N rows.
Example:
> printTree(3)
​ *
-
---
-----
Â
Two red blood cells fell in love. But alas, it was in vein.
Â
That’s all for now, folks. Have a good week. Be safe, make good choices, and clean your room.
cassidoo