diff options
| author | mo khan <mo.khan@gmail.com> | 2020-11-30 10:03:37 -0700 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-11-30 10:03:37 -0700 |
| commit | 0a57fa76953b4d1ef9f3553449a1365b6aaa5b7c (patch) | |
| tree | bca217584bcb1b0dc411b64c1af1d85f90ca9437 /2020 | |
| parent | 40cc5665bcca9b3ecd7f38d39ec5a3ff6e412bed (diff) | |
Add daily problem
Diffstat (limited to '2020')
| -rw-r--r-- | 2020/11/30/README.md | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/2020/11/30/README.md b/2020/11/30/README.md new file mode 100644 index 0000000..d6465dd --- /dev/null +++ b/2020/11/30/README.md @@ -0,0 +1,20 @@ +Given a list of building in the form of (left, right, height), return +what the skyline should look like. The skyline should be in the form of +a list of (x-axis, height), where x-axis is the next point where there +is a change in height starting from 0, and height is the new height +starting from the x-axis. + +Here's some starter code: + +```ruby +def generate_skyline(buildings): +# Fill this in. +# 2 2 2 +# 2 2 2 +# 1 1 2 2 2 1 1 +# 1 1 2 2 2 1 1 +# 1 1 2 2 2 1 1 +# pos: 1 2 3 4 5 6 7 8 9 +print generate_skyline([(2, 8, 3), (4, 6, 5)]) +# [(2, 3), (4, 5), (7, 3), (9, 0)] +``` |
