I've skipped quite a lot of Cassidoo's question of the week this summer, but let's get back to it, in SQL of course!

The question

This week’s question: Write a function to find the longest common prefix string in an array of strings.

Example:

$ longestPrefix(["cranberry","crawfish","crap"...

I feel like I'm gonna like this serie a lot :-) It's so much fun!

Let's dive right in!

The interview question

Write a function that draws an ASCII art cube of given height x.

Example:

$ drawCube(2)
  +----+
 /    /|
+----+ |
|    | +
|    |/
+----+

$ drawCube(4)

   +--------+
  /...

I've recently discovered Cassidy's newsletter, more precisely this one and really liked it:

  • it's short
  • it's fun
  • and there is a fun interview question

I admit I haven't read the linked articles :-)

This week’s question:

Given a direction and a number of columns, write a function...