The vital message to Romeo doesn't arrive in time because the plague is in town (so the messenger cannot leave Verona). Hearing from his servant that Juliet is dead, Romeo buys poison from an Apothecary in Mantua. He returns to Verona and goes to the tomb where he surprises and kills the mourning Paris. Romeo takes his poison and dies, while Juliet awakens from her drugged coma. She learns what has happened from Friar Laurence, but she refuses to leave the tomb and stabs herself.
Montague's son Romeo and his friends (Benvolio and Mercutio) hear of the party and resolve to go in disguise. Romeo hopes to see his beloved Rosaline at the party. Instead, while there, he meets Juliet and falls instantly in love with her. Juliet's cousin Tybalt recognises the Montague boys and forces them to leave just as Romeo and Juliet discover one another.
Given a staircase with a given number of stairs, num, write a function that returns the number of different ways one can climb this set of stairs. A person is able to climb the stairs either one at a time, or skip a step, or a mix of both.
climbStairs(2); // should return 2: one step at a time (1 + 1), or skip a step (2).
climbStairs(0); // should return 1
climbStairs(1); // should return 1
climbStairs(5); // should return 8
climbStairs(100); // should return 573147844013817200640
Create a Doubly Linked List (each node has reference to both the previous and next nodes) with the following methods:
- addToHead(value): this should add a node to the beginning of our list
- addToTail(value): this should add a node to the end of our list
- remove(value): this should remove the first node where the value is equal to our given value (from head to tail)
- contains(value): this should return true if our list has a given value, false if not
Let's take a look at one of the best classic games!
(https://www.youtube.com/watch?v=ia8bhFoqkVE "Super Mario Bros Gameplay") (Watch from 0:00 - 1:00)
If you already understand the basics of how Super Mario works, feel free to skip to the prompt!
Given a 2-Dimensional array (Essentially a grid), write a function that searches for all the values that equal 0 in the array, and then turns all values in the same row and column as the zero into other zeros.
In the event that there are no zeros in the input array, then simply return the input array.
Given two strings, write a function that returns true if one string is a rotation of the other string. In this case, a string rotation is a string that is misplaced by one cut. And example would be: "goodbye" and "odbyego" -> these are a rotation of each other.
This is very similar to other string permutation problems where checking a character count is appropriate. In this case it would not accurately get the job done, so keep that in mind.
There are three types of edits that can be made to a string:
- Replace: Replacing a single character with another character on the string
- Insert: Inserting a single character into a string, making it 1 length longer
- Removal: Deleting a single character from a string, making it 1 length shorter
Write a function that takes in two strings, and returns true if the two strings are one "edit" or zero "edits" away from each other (false if not).