Permalink
Browse files

initial code

  • Loading branch information...
oduvan committed Oct 17, 2018
1 parent c3319d4 commit 16dcea54e9e7b23a3b88d20e392d3f9ecabb2b32
Showing with 52 additions and 15 deletions.
  1. +25 −7 editor/initial_code/js_node
  2. +27 −8 editor/initial_code/python_3
@@ -1,19 +1,37 @@
"use strict";

function sumTwo(a, b) {
// sums two passed arguments

function rectanglesUnion(recs) {
// your code here
return 0;
}

var assert = require('assert');
if (!global.is_checking) {
console.log('Example:')
console.log(sumTwo(3, 2))
console.log(rectanglesUnion([
[6, 3, 8, 10],
[4, 8, 11, 10],
[16, 8, 19, 11]
]))

// These "asserts" are used for self-checking and not for an auto-testing
assert.equal(sumTwo(3, 2), 5)
assert.equal(sumTwo(5, 7), 12)
assert.equal(rectanglesUnion([
[6, 3, 8, 10],
[4, 8, 11, 10],
[16, 8, 19, 11]
]), 33)
assert.equal(rectanglesUnion([
[16, 8, 19, 11]
]), 9)
assert.equal(rectanglesUnion([
[16, 8, 19, 11],
[16, 8, 19, 11]
]), 9)
assert.equal(rectanglesUnion([
[16, 8, 16, 8]
]), 0)
assert.equal(rectanglesUnion([

]), 0)
console.log("Coding complete? Click 'Check' to earn cool rewards!");
}
}
@@ -1,16 +1,35 @@
def sum_two(a, b):
"""
sums two passed arguments
"""
from typing import List, Tuple

def rectangles_union(recs: List[Tuple[int]]) -> int:
# your code here
return None
return 0


if __name__ == '__main__':
print("Example:")
print(sum_two(3, 2))
print(rectangles_union([
(6, 3, 8, 10),
(4, 8, 11, 10),
(16, 8, 19, 11)
]))

# These "asserts" are used for self-checking and not for an auto-testing
assert sum_two(3, 2) == 5, "First"
assert sum_two(5, 7) == 12, "Second"
assert rectangles_union([
(6, 3, 8, 10),
(4, 8, 11, 10),
(16, 8, 19, 11)
]) == 33
assert rectangles_union([
(16, 8, 19, 11)
]) == 9
assert rectangles_union([
(16, 8, 19, 11),
(16, 8, 19, 11)
]) == 9
assert rectangles_union([
(16, 8, 16, 8)
]) == 0
assert rectangles_union([

]) == 0
print("Coding complete? Click 'Check' to earn cool rewards!")

0 comments on commit 16dcea5

Please sign in to comment.