Commit 0a57fa7

mo khan <mo.khan@gmail.com>
2020-11-30 17:03:37
Add daily problem
1 parent 40cc566
Changed files (1)
2020
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)]
+```