Hi there friends!
Based on your responses to my last letter, we're back to scheduling these so you get them at the beginning of the week! Woo hoo! Let's get groovin.
Â
Web links of the week
Bit fields in JavaScript
How to build a custom date picker with React
33 Concepts Every JavaScript Developer Should KnowÂ
Get ready! Game Off returns in November
Â
Something that interested me this week
The
Scrabble keycaps I designed have officially started shipping! It's been surreal seeing something that I've been working on for so long out in the wild.
I made a Twitter thread of the pictures I've been seeing around the internet, and it's been so fun populating it more and more everyday. It's been
a long journey, and it's a fantastic feeling being able to start and finish a project like this. As this chapter closes, another one begins... what it'll be, that's TBD. 😉
Â
Interview question of the week
Last week I had you remove excess parenthesis from a string. Laura sent this answer!
def remove_excess_parentheses(s):
  """
  :type s: str
  :rtype: str
  """
  # maintain a stack of parentheses where each parenthesis also has its index attached (for removal afterwards, if necessary)
  stack = []
  res = []
  l = len(s)
  for i in range(l):
    if s[i] == "(":
      stack.append((i,s[i]))
      res.append(s[i])
    elif s[i] == ")":
      if len(stack) != 0:
        top = stack.pop()
        res.append(")")
      else:
        res.append("")
    else:
      res.append(s[i])
  for i,c in stack:
    res[i] = ""
  return "".join(res)
This week's question:
Given a number n, return a list of numbers less than n which are a product of distinct prime numbers.
Example:
primeProducts(30)
> [6, 10, 14, 15, 21, 22, 26]
Â
Cool things from around the internet
Kinky Labor Supply and the Attention Tax
Programming Sucks
How African Barns Inspired The Conservatory By Nadine Engelbrecht Architects
My Baby Won’t Sleep. Help Me AI, You’re My Only Hope.
Â
Joke
No matter how much you push the envelope, it's still stationary.
Â
That's all for now, folks! Have a great week. Be safe, make good choices, and stretch your arms and neck regularly. Do it now.
cassidoo