Package: Validate challenges on test (#17216)
This PR allows us to validate the schema during test. It also removes some cruft from the seed files and ensures only the required data is packaged and consumable, reducing the package weight somewhat.
This commit is contained in:
committed by
mrugesh mohapatra
parent
afc948890c
commit
4e645a5ff6
@ -73,7 +73,6 @@
|
||||
"testString": "assert.equal(sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3], [5, 3, 9, 8], [1]).length, 8, '<code>sym([3, 3, 3, 2, 5], [2, 1, 5, 7], [3, 4, 6, 6], [1, 2, 3], [5, 3, 9, 8], [1])</code> should contain only eight elements.');"
|
||||
}
|
||||
],
|
||||
"type": "bonfire",
|
||||
"MDNlinks": [
|
||||
"Array.prototype.reduce()",
|
||||
"Symmetric Difference"
|
||||
@ -158,7 +157,6 @@
|
||||
"testString": "assert.deepEqual(updateInventory([[0, \"Bowling Ball\"], [0, \"Dirty Sock\"], [0, \"Hair Pin\"], [0, \"Microphone\"]], [[1, \"Hair Pin\"], [1, \"Half-Eaten Apple\"], [1, \"Bowling Ball\"], [1, \"Toothpaste\"]]), [[1, \"Bowling Ball\"], [0, \"Dirty Sock\"], [1, \"Hair Pin\"], [1, \"Half-Eaten Apple\"], [0, \"Microphone\"], [1, \"Toothpaste\"]], '<code>updateInventory([[0, \"Bowling Ball\"], [0, \"Dirty Sock\"], [0, \"Hair Pin\"], [0, \"Microphone\"]], [[1, \"Hair Pin\"], [1, \"Half-Eaten Apple\"], [1, \"Bowling Ball\"], [1, \"Toothpaste\"]])</code> should return <code>[[1, \"Bowling Ball\"], [0, \"Dirty Sock\"], [1, \"Hair Pin\"], [1, \"Half-Eaten Apple\"], [0, \"Microphone\"], [1, \"Toothpaste\"]]</code>.');"
|
||||
}
|
||||
],
|
||||
"type": "bonfire",
|
||||
"MDNlinks": [
|
||||
"Global Array Object"
|
||||
],
|
||||
@ -272,7 +270,6 @@
|
||||
"testString": "assert.strictEqual(permAlone('aaabb'), 12, '<code>permAlone(\"aaabb\")</code> should return 12.');"
|
||||
}
|
||||
],
|
||||
"type": "bonfire",
|
||||
"MDNlinks": [
|
||||
"Permutations",
|
||||
"RegExp"
|
||||
@ -358,7 +355,6 @@
|
||||
"testString": "assert.deepEqual(pairwise([], 100), 0, '<code>pairwise([], 100)</code> should return 0.');"
|
||||
}
|
||||
],
|
||||
"type": "bonfire",
|
||||
"MDNlinks": [
|
||||
"Array.prototype.reduce()"
|
||||
],
|
||||
@ -443,7 +439,6 @@
|
||||
"testString": "assert.strictEqual(code.search(/\\.sort\\(/), -1, '<code>bubbleSort</code> should not use the built-in <code>.sort()</code> method.');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"solutions": [],
|
||||
"challengeType": 1,
|
||||
"translations": {},
|
||||
@ -500,7 +495,6 @@
|
||||
"testString": "assert.strictEqual(code.search(/\\.sort\\(/), -1, '<code>selectionSort</code> should not use the built-in <code>.sort()</code> method.');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"solutions": [],
|
||||
"challengeType": 1,
|
||||
"translations": {},
|
||||
@ -557,7 +551,6 @@
|
||||
"testString": "assert.strictEqual(code.search(/\\.sort\\(/), -1, '<code>insertionSort</code> should not use the built-in <code>.sort()</code> method.');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"solutions": [],
|
||||
"challengeType": 1,
|
||||
"translations": {},
|
||||
@ -615,7 +608,6 @@
|
||||
"testString": "assert.strictEqual(code.search(/\\.sort\\(/), -1, '<code>quickSort</code> should not use the built-in <code>.sort()</code> method.');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"solutions": [],
|
||||
"challengeType": 1,
|
||||
"translations": {},
|
||||
@ -676,7 +668,6 @@
|
||||
"testString": "assert.strictEqual(code.search(/\\.sort\\(/), -1, '<code>mergeSort</code> should not use the built-in <code>.sort()</code> method.');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"solutions": [],
|
||||
"challengeType": 1,
|
||||
"translations": {},
|
||||
|
@ -39,7 +39,6 @@
|
||||
"testString": "assert(i32View.length === 16, 'Your <code>i32View</code> view of your buffer should be 16 elements long.');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [
|
||||
"var buffer = new ArrayBuffer(64);\nvar i32View = new Int32Array(buffer);"
|
||||
@ -93,7 +92,6 @@
|
||||
],
|
||||
"solutions": [],
|
||||
"hints": [],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"challengeType": 1,
|
||||
"translations": {},
|
||||
@ -163,7 +161,6 @@
|
||||
],
|
||||
"solutions": [],
|
||||
"hints": [],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"challengeType": 1,
|
||||
"translations": {},
|
||||
@ -238,7 +235,6 @@
|
||||
],
|
||||
"solutions": [],
|
||||
"hints": [],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"challengeType": 1,
|
||||
"translations": {},
|
||||
@ -305,7 +301,6 @@
|
||||
"testString": "assert((function(){var test = new PriorityQueue(); test.enqueue(['A', 5]); test.enqueue(['B', 5]); test.enqueue(['C', 5]); test.enqueue(['D', 3]); test.enqueue(['E', 1]); test.enqueue(['F', 7]); var result = []; result.push(test.dequeue()); result.push(test.dequeue()); result.push(test.dequeue()); result.push(test.dequeue()); result.push(test.dequeue()); result.push(test.dequeue()); return result.join('') === 'EDABCF';}()), 'The priority queue should return items with a higher priority before items with a lower priority and return items in first-in-first-out order otherwise.');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [
|
||||
"function PriorityQueue () { \n this.collection = []; \n this.printCollection = function(){ \n console.log(this.collection); \n }; \n this.size = function() { \n return this.collection.length; \n }; \n this.isEmpty = function() { \n return this.size() > 0 ? false : true; \n }; \n this.enqueue = function (newitem) {\n if (this.isEmpty()) {\n return this.collection.push(newitem);\n }\n\n this.collection = this.collection.reverse();\n var found_index = this.collection.findIndex(function (item) {\n return newitem[1] >= item[1];\n });\n if (found_index === -1) {\n this.collection.push(newitem);\n } else {\n this.collection.splice(found_index, 0, newitem);\n }\n this.collection = this.collection.reverse();\n}; \n this.dequeue = function() { \n if (!this.isEmpty()) { \n return this.collection.shift()[0]; \n } else { \n return 'The queue is empty.' \n } \n }; \n }"
|
||||
@ -373,7 +368,6 @@
|
||||
"testString": "assert((function(){ var test = new CircularQueue(3); test.enqueue(17); test.enqueue(32); test.enqueue(591); return test.dequeue() === 17 && test.dequeue() === 32 && test.dequeue() === 591 && test.dequeue() === null && test.dequeue() === null && test.dequeue() === null && test.dequeue() === null && test.enqueue(100) === 100 && test.dequeue() === 100; })(), 'Trying to dequeue past the write pointer returns <code>null</code> and does not advance the write pointer.');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [
|
||||
"class CircularQueue { \n constructor(size) { \n this.queue = []; \n this.read = 0; \n this.write = 0; \n this.max = size - 1; \n while (size > 0) { \n this.queue.push(null); \n size--; \n } \n } \n print() { \n return this.queue; \n } \n enqueue(item) { \n if (this.queue[this.write] === null) { \n this.queue[this.write] = item; \n if (this.write === this.max) { \n this.write = 0; \n } else { \n this.write++; \n } \n return item; \n } \n return null; \n } \n dequeue() { \n if (this.queue[this.read] !== null) { \n var item = this.queue[this.read]; \n this.queue[this.read] = null; \n if (this.read === this.max) { \n this.read = 0; \n } else { \n this.read++; \n } \n return item; \n } else { \n return null; \n } \n } \n }"
|
||||
@ -453,7 +447,6 @@
|
||||
"testString": "assert((function(){var test = new Set(); test.add('a'); var result = test.add('a'); return (result != undefined) && (result === false);}()), 'Your <code>add</code> method should return <code>false</code> when a duplicate value is added.');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [
|
||||
"function Set() {var collection = []; this.has = function(e){return(collection.indexOf(e) !== -1);};this.values = function() {return collection;};this.add = function(element) {if (!this.has(element)) {collection.push(element);return true;} else {return false;}};}"
|
||||
@ -506,7 +499,6 @@
|
||||
"testString": "assert((function(){var test = new Set(); test.add('a');test.add('b');test.remove('a'); var vals = test.values(); return (vals[0] === 'b' && vals.length === 1)}()), 'Your <code>remove</code> method should remove the given item from the set.');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [
|
||||
"function Set() {var collection = []; this.has = function(e){return(collection.indexOf(e) !== -1);};this.values = function() {return collection;};this.add = function(element) {if (!this.has(element)) {collection.push(element);return true;} else {return false;}};this.remove = function(element) {if(this.has(element)) {var i = collection.indexOf(element);collection.splice(i, 1);return true;}return false;};}"
|
||||
@ -563,7 +555,6 @@
|
||||
"testString": "assert((function(){var test = new Set(); test.add('a');test.add('b');test.remove('a');return (test.size() === 1)}()), 'The <code>size</code> method should return the number of elements in the collection.');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [
|
||||
"function Set() {var collection = []; this.has = function(e){return(collection.indexOf(e) !== -1);};this.values = function() {return collection;};this.add = function(element) {if (!this.has(element)) {collection.push(element);return true;} else {return false;}};this.remove = function(element) {if(this.has(element)) {var i = collection.indexOf(element);collection.splice(i, 1);return true;}return false;};this.size = function() {return collection.length;};}"
|
||||
@ -630,7 +621,6 @@
|
||||
"testString": "assert((function(){var setA = new Set(); var setB = new Set(); setA.add('a'); setA.add('b'); setA.add('c'); setB.add('c'); setB.add('d'); var unionSetAB = setA.union(setB); var final = unionSetAB.values(); return (final.indexOf('a') !== -1 && final.indexOf('b') !== -1 && final.indexOf('c') !== -1 && final.indexOf('d') !== -1 && final.length === 4)})(), 'The proper collection was returned');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [
|
||||
"function Set() {var collection = []; this.has = function(e){return(collection.indexOf(e) !== -1);};this.values = function() {return collection;};this.add = function(element) {if (!this.has(element)) {collection.push(element);return true;} else {return false;}};this.remove = function(element) {if(this.has(element)) {var i = collection.indexOf(element);collection.splice(i, 1);return true;}return false;};this.size = function() {return collection.length;};this.union = function(set) {var u = new Set();var c = this.values();var s = set.values();c.forEach(function(element){u.add(element);});s.forEach(function(element){u.add(element);});return u;};}"
|
||||
@ -702,7 +692,6 @@
|
||||
"testString": "assert(function(){ var setA = new Set(); var setB = new Set(); setA.add('a'); setA.add('b'); setA.add('c'); setB.add('c'); setB.add('d'); var intersectionSetAB = setA.intersection(setB); return (intersectionSetAB.size() === 1 && intersectionSetAB.values()[0] === 'c')}, 'The proper collection was returned');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [
|
||||
"function Set() {var collection = []; this.has = function(e){return(collection.indexOf(e) !== -1);};this.values = function() {return collection;};this.add = function(element) {if (!this.has(element)) {collection.push(element);return true;} else {return false;}};this.remove = function(element) {if(this.has(element)) {var i = collection.indexOf(element);collection.splice(i, 1);return true;}return false;};this.size = function() {return collection.length;};this.union = function(set) {var u = new Set();var c = this.values();var s = set.values();c.forEach(function(element){u.add(element);});s.forEach(function(element){u.add(element);});return u;};this.intersection = function(set) {var i = new Set();var c = this.values();c.forEach(function(element){if(s.has(element)) i.add(element);});};}"
|
||||
@ -786,7 +775,6 @@
|
||||
"testString": "assert(function(){var setA = new Set(); var setB = new Set(); setA.add('a'); setA.add('b'); setA.add('c'); setB.add('c'); setB.add('d'); var differenceSetAB = setA.difference(setB); return (differenceSetAB.size() === 2) && (differenceSetAB.values() === [ 'a', 'b' ])}, 'The proper collection was returned');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [
|
||||
"function Set() {var collection = []; this.has = function(e){return(collection.indexOf(e) !== -1);};this.values = function() {return collection;};this.add = function(element) {if (!this.has(element)) {collection.push(element);return true;} else {return false;}};this.remove = function(element) {if(this.has(element)) {var i = collection.indexOf(element);collection.splice(i, 1);return true;}return false;};this.size = function() {return collection.length;};this.union = function(set) {var u = new Set();var c = this.values();var s = set.values();c.forEach(function(element){u.add(element);});s.forEach(function(element){u.add(element);});return u;};this.intersection = function(set) {var i = new Set();var c = this.values();c.forEach(function(element){if(s.has(element)) i.add(element);});};this.difference = function(set) {var d = new Set();var c = this.values();c.forEach(function(e){if(!set.has(e)) d.add(e);});};}"
|
||||
@ -897,7 +885,6 @@
|
||||
"testString": "assert(function(){var setA = new Set(); var setB = new Set(); setA.add('a'); setA.add('b'); setB.add('c'); setB.add('d'); var subsetSetAB = setA.subset(setB); return (subsetSetAB === false)}, \"<code>['a', 'b'].subset(['c', 'd'])</code> should return <code>false</code>\");"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [
|
||||
"function Set() {var collection = []; this.has = function(e){return(collection.indexOf(e) !== -1);};this.values = function() {return collection;};this.add = function(element) {if (!this.has(element)) {collection.push(element);return true;} else {return false;}};this.remove = function(element) {if(this.has(element)) {var i = collection.indexOf(element);collection.splice(i, 1);return true;}return false;};this.size = function() {return collection.length;};this.union = function(set) {var u = new Set();var c = this.values();var s = set.values();c.forEach(function(element){u.add(element);});s.forEach(function(element){u.add(element);});return u;};this.intersection = function(set) {var i = new Set();var c = this.values();c.forEach(function(element){if(s.has(element)) i.add(element);});};this.difference = function(set) {var d = new Set();var c = this.values();c.forEach(function(e){if(!set.has(e)) d.add(e);});};this.subset = function(set) {var isSubset = true;var c = this.values();c.forEach(function(e){if(!set.has(e)) isSubset = false;});return isSubset;};}"
|
||||
@ -1010,7 +997,6 @@
|
||||
"testString": "assert(function(){var test = checkSet(); return (test.size == 6) && test.has(1) && test.has(2) && test.has(3) && test.has('Taco') && test.has('Cat') && test.has('Awesome');}, 'Your <code>Set</code> should only contains the values <code>1, 2, 3, Taco, Cat, Awesome</code>.');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [
|
||||
"function checkSet(){var set = new Set([1,2,3,'Taco','Cat','Awesome']);\nreturn set;}"
|
||||
@ -1057,7 +1043,6 @@
|
||||
"testString": "assert(function(){var test = checkSet(); return test.has(1) && test.has(3) && test.has(4) && test.size === 3}, 'Your Set should contain the values 1, 3, & 4');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [
|
||||
"function checkSet(){\nvar set = new Set([1,2,3,4,5]);\nset.delete(2);\nset.delete(5);\nreturn set;}"
|
||||
@ -1103,7 +1088,6 @@
|
||||
"testString": "assert(function(){var test = checkSet([4,5,6], 3); test === [ false, 3 ]}, '<code>checkSet([4, 5, 6], 3)</code> should return [ false, 3 ]');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [
|
||||
"function checkSet(arrToBeSet, checkValue){\nvar set = new Set(arrToBeSet);\nvar result = [\nset.has(checkValue),\nset.size\n];\nreturn result;\n}"
|
||||
@ -1149,7 +1133,6 @@
|
||||
"testString": "assert(function(){var test = checkSet(new Set([1,2,3,4,5,6,7])); test === [ 1, 2, 3, 4, 5, 6, 7 ]}, 'Your Set was returned correctly!');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [
|
||||
"function checkSet(set){\nreturn [...set];}"
|
||||
@ -1218,7 +1201,6 @@
|
||||
"testString": "assert((function() { var test = false; if (typeof Map !== 'undefined') { test = new Map() }; test.add('b','b'); test.add('c','d'); test.remove('asdfas'); var init = test.size(); test.clear(); return (init == 2 && test.size() == 0)})(), 'The clear method empties the map and the size method returns the number of items present in the map.');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [],
|
||||
"challengeType": 1,
|
||||
@ -1264,7 +1246,6 @@
|
||||
"testString": "assert(myMap.get('freeCodeCamp') === 'Awesome!', 'myMap contains the key value pair <code>freeCodeCamp</code>, <code>Awesome!</code>.');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [],
|
||||
"challengeType": 1,
|
||||
@ -1326,7 +1307,6 @@
|
||||
"testString": "assert((function() { var test = false; if (typeof HashTable !== 'undefined') { test = new HashTable() }; called = 0; test.add('key1','value1'); test.add('1key','value2'); test.add('ke1y','value3'); return (test.lookup('key1') === 'value1' && test.lookup('1key') == 'value2' && test.lookup('ke1y') == 'value3')})(), 'The hash table handles collisions.');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [],
|
||||
"challengeType": 1,
|
||||
@ -1385,7 +1365,6 @@
|
||||
],
|
||||
"solutions": [],
|
||||
"hints": [],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"challengeType": 1,
|
||||
"translations": {},
|
||||
@ -1446,7 +1425,6 @@
|
||||
],
|
||||
"solutions": [],
|
||||
"hints": [],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"challengeType": 1,
|
||||
"translations": {},
|
||||
@ -1520,7 +1498,6 @@
|
||||
"class Node {\n constructor (element) {\n this.element = element;\n this.next = null;\n }\n}\n\nclass LinkedList {\n constructor () {\n this._length = 0;\n this._head = null;\n }\n\n head () {\n return this._head;\n }\n\n size () {\n return this._length;\n }\n\n add (element) {\n const node = new Node(element);\n\n if (this._head === null) {\n this._head = node;\n } else {\n let current = this._head;\n\n while (current.next !== null) {\n current = current.next;\n }\n\n current.next = node; \n }\n \n ++this._length;\n }\n \n remove (element) {\n if (this._head === null) return;\n \n let previous;\n let current = this._head;\n \n while (current.next !== null && current.element !== element) {\n previous = current;\n current = current.next;\n }\n \n if (previous) {\n previous.next = current.next;\n } else {\n this._head = current.next;\n }\n \n --this._length;\n }\n}"
|
||||
],
|
||||
"hints": [],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"challengeType": 1,
|
||||
"translations": {},
|
||||
@ -1610,7 +1587,6 @@
|
||||
],
|
||||
"solutions": [],
|
||||
"hints": [],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"challengeType": 1,
|
||||
"translations": {},
|
||||
@ -1718,7 +1694,6 @@
|
||||
],
|
||||
"solutions": [],
|
||||
"hints": [],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"challengeType": 1,
|
||||
"translations": {},
|
||||
@ -1817,7 +1792,6 @@
|
||||
],
|
||||
"solutions": [],
|
||||
"hints": [],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"challengeType": 1,
|
||||
"translations": {},
|
||||
@ -1916,7 +1890,6 @@
|
||||
"testString": "assert((function() { var test = false; if (typeof DoublyLinkedList !== 'undefined') { test = new DoublyLinkedList() }; test.add(25); test.add(35); test.add(60); test.remove(60); return ( test.print().join('') == '2535' ) })(), 'The last item can be removed from the list.');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [],
|
||||
"challengeType": 1,
|
||||
@ -2007,7 +1980,6 @@
|
||||
"testString": "assert((function() { var test = false; if (typeof DoublyLinkedList !== 'undefined') { test = new DoublyLinkedList() }; test.add(11); test.add(22); test.add(33); test.reverse(); return (test.printReverse().join('') == '112233'); })(), 'The next and previous references are correctly maintained when a list is reversed.');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [],
|
||||
"challengeType": 1,
|
||||
@ -2120,7 +2092,6 @@
|
||||
"testString": "assert((function() { var test = false; if (typeof BinarySearchTree !== 'undefined') { test = new BinarySearchTree() } else { return false; }; if (typeof test.findMin !== 'function') { return false; }; if (typeof test.findMax !== 'function') { return false; }; return (test.findMin() == null && test.findMax() == null) })(), 'The <code>findMin</code> and <code>findMax</code> methods return <code>null</code> for an empty tree.');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [],
|
||||
"challengeType": 1,
|
||||
@ -2205,7 +2176,6 @@
|
||||
"testString": "assert((function() { var test = false; if (typeof BinarySearchTree !== 'undefined') { test = new BinarySearchTree() } else { return false; }; if (typeof test.add !== 'function') { return false; }; test.add(4); return test.add(4) == null; })(), 'Adding an element that already exists returns <code>null</code>');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [],
|
||||
"challengeType": 1,
|
||||
@ -2289,7 +2259,6 @@
|
||||
"testString": "assert((function() { var test = false; if (typeof BinarySearchTree !== 'undefined') { test = new BinarySearchTree() } else { return false; }; if (typeof test.isPresent !== 'function') { return false; }; return test.isPresent(5) == false; })(), '<code>isPresent</code> handles cases where the tree is empty.');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [],
|
||||
"challengeType": 1,
|
||||
@ -2391,7 +2360,6 @@
|
||||
"testString": "assert((function() { var test = false; if (typeof BinarySearchTree !== 'undefined') { test = new BinarySearchTree() } else { return false; }; if (typeof test.isBalanced !== 'function') { return false; }; test.add(4); test.add(1); test.add(7); test.add(87); test.add(34); test.add(45); test.add(73); test.add(8); return test.isBalanced(); })(), 'The <code>isBalanced</code> method returns true if the tree is a balanced binary search tree.');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [],
|
||||
"challengeType": 1,
|
||||
@ -2504,7 +2472,6 @@
|
||||
"testString": "assert((function() { var test = false; if (typeof BinarySearchTree !== 'undefined') { test = new BinarySearchTree() } else { return false; }; if (typeof test.postorder !== 'function') { return false; }; return (test.postorder() == null); })(), 'The <code>postorder</code> method returns <code>null</code> for an empty tree.');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [],
|
||||
"challengeType": 1,
|
||||
@ -2601,7 +2568,6 @@
|
||||
"testString": "assert((function() { var test = false; if (typeof BinarySearchTree !== 'undefined') { test = new BinarySearchTree() } else { return false; }; if (typeof test.reverseLevelOrder !== 'function') { return false; }; return (test.reverseLevelOrder() == null); })(), 'The <code>reverseLevelOrder</code> method returns <code>null</code> for an empty tree.');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [],
|
||||
"challengeType": 1,
|
||||
@ -2694,7 +2660,6 @@
|
||||
"testString": "assert((function() { var test = false; if (typeof BinarySearchTree !== 'undefined') { test = new BinarySearchTree() } else { return false; }; if (typeof test.remove !== 'function') { return false; }; test.add(5); test.add(3); test.add(7); test.add(6); test.add(10); test.add(12); test.remove(3); test.remove(12); test.remove(10); return (test.inorder().join('') == '567'); })(), 'The <code>remove</code> method removes leaf nodes from the tree');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [],
|
||||
"challengeType": 1,
|
||||
@ -2835,7 +2800,6 @@
|
||||
"testString": "assert((function() { var test = false; if (typeof BinarySearchTree !== 'undefined') { test = new BinarySearchTree() } else { return false; }; if (typeof test.remove !== 'function') { return false; }; test.add(15); test.add(27); test.remove(15); return (test.inorder().join('') == '27'); })(), 'Removing the root in a tree with two nodes sets the second to be the root.');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [],
|
||||
"challengeType": 1,
|
||||
@ -3026,7 +2990,6 @@
|
||||
"testString": "assert((function() { var test = false; if (typeof BinarySearchTree !== 'undefined') { test = new BinarySearchTree() } else { return false; }; if (typeof test.remove !== 'function') { return false; }; test.add(100); test.add(50); test.add(300); test.remove(100); return (test.inorder().join('') == 50300); })(), 'The root can be removed on a tree of three nodes.');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [],
|
||||
"challengeType": 1,
|
||||
@ -3209,7 +3172,6 @@
|
||||
"testString": "assert((function() { var test = false; if (typeof BinarySearchTree !== 'undefined') { test = new BinarySearchTree() } else { return false; }; if (typeof test.invert !== 'function') { return false; }; return (test.invert() == null); })(), 'Inverting an empty tree returns <code>null</code>.');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [],
|
||||
"challengeType": 1,
|
||||
@ -3318,7 +3280,6 @@
|
||||
"testString": "assert((function testTrie() { var test = false; if (typeof Trie !== 'undefined') { test = new Trie() } else { return false; }; test.add('hop'); test.add('hops'); test.add('hopped'); test.add('hoppy'); test.add('hope'); return (test.isWord('hop') && !test.isWord('ho') && test.isWord('hopped') && !test.isWord('hopp') && test.isWord('hoppy') && !test.isWord('hoping')); }()), 'The isWord method returns true only for words added to the trie and false for all other words.');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [],
|
||||
"challengeType": 1,
|
||||
@ -3389,7 +3350,6 @@
|
||||
"testString": "assert((function() { var test = false; if (typeof MaxHeap !== 'undefined') { test = new MaxHeap() } else { return false; }; test.insert(50); test.insert(100); test.insert(700); test.insert(32); test.insert(51); let result = test.print(); return ((result.length == 5) ? result[0] == 700 : result[1] == 700) })(), 'The insert method adds elements according to the max heap property.');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [],
|
||||
"challengeType": 1,
|
||||
@ -3442,7 +3402,6 @@
|
||||
"testString": "assert((function() { var test = false; if (typeof MaxHeap !== 'undefined') { test = new MaxHeap() } else { return false; }; test.insert(30); test.insert(300); test.insert(500); test.insert(10); let result = []; result.push(test.remove()); result.push(test.remove()); result.push(test.remove()); result.push(test.remove()); return (result.join('') == '5003003010') })(), 'The remove method removes the greatest element from the max heap while maintaining the max heap property.');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [],
|
||||
"challengeType": 1,
|
||||
@ -3493,7 +3452,6 @@
|
||||
"testString": "assert((function() { var test = false; if (typeof MinHeap !== 'undefined') { test = new MinHeap() } else { return false; }; test.insert(3); test.insert(12); test.insert(5); test.insert(10); test.insert(1); test.insert(27); test.insert(42); test.insert(57); test.insert(5); var result = test.sort(); return (isSorted(result)); })(), 'The sort method returns an array containing all items added to the min heap in sorted order.');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [],
|
||||
"challengeType": 1,
|
||||
@ -3558,7 +3516,6 @@
|
||||
"testString": "assert(undirectedAdjList.Jeff.indexOf(\"Jenny\") !== -1 && undirectedAdjList.Jenny.indexOf(\"Jeff\") !== -1, 'There should be an edge between <code>Jeff</code> and <code>Jenny</code>.');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [
|
||||
"var undirectedAdjList = {\n\"James\": [\"Jeff\"],\"Jill\": [\"Jenny\"],\"Jenny\": [\"Jill\", \"Jeff\"],\n\"Jeff\": [\"James\", \"Jenny\"]\n};"
|
||||
@ -3618,7 +3575,6 @@
|
||||
"testString": "assert((adjMatUndirected[3][4] === 1) && (adjMatUndirected[4][3] === 1), 'There should be an edge between the fourth and fifth node.');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [
|
||||
"var adjMatUndirected = [[0, 0, 1, 1, 0],[0, 0, 0, 0, 0],[1, 0, 0, 0, 1],[1, 0, 0, 0, 1],[0, 0, 1, 1, 0]];"
|
||||
@ -3681,7 +3637,6 @@
|
||||
"testString": "assert((incMatUndirected[1][3] === 1) && (incMatUndirected[3][3] === 1), 'There should be a fourth edge between the second and fourth node.');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [
|
||||
"var incMatUndirected = [[1, 0, 0, 0],[1, 1, 0, 1],[0, 1, 1, 0],[0, 0, 0, 1],[0, 0, 1, 0]];"
|
||||
@ -3738,7 +3693,6 @@
|
||||
"testString": "assert((function() { var graph = [[0, 1], [1, 0]]; var results = bfs(graph, 0); return isEquivalent(results, {0: 0, 1: 1})})(), 'The input graph <code>[[0, 1], [1, 0]]</code> with a start node of <code>0</code> should return <code>{0: 0, 1: 1}</code>');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [
|
||||
"function bfs(graph, root) {\n// Distance object returned\nvar nodesLen = {};\n// Set all distances to infinity\nfor (var i = 0; i < graph.length; i++) {\nnodesLen[i] = Infinity;\n}\nnodesLen[root] = 0; // ...except root node\nvar queue = [root]; // Keep track of nodes to visit\nvar current; // Current node traversing\n// Keep on going until no more nodes to traverse\nwhile (queue.length !== 0) {\ncurrent = queue.shift();\n// Get adjacent nodes from current node\nvar curConnected = graph[current]; // Get layer of edges from current\nvar neighborIdx = []; // List of nodes with edges\nvar idx = curConnected.indexOf(1); // Get first edge connection\nwhile (idx !== -1) {\nneighborIdx.push(idx); // Add to list of neighbors\nidx = curConnected.indexOf(1, idx + 1); // Keep on searching\n}\n// Loop through neighbors and get lengths\nfor (var j = 0; j < neighborIdx.length; j++) {\n// Increment distance for nodes traversed\nif (nodesLen[neighborIdx[j]] === Infinity) {\nnodesLen[neighborIdx[j]] = nodesLen[current] + 1;\nqueue.push(neighborIdx[j]); // Add new neighbors to queue\n}\n}\n}\nreturn nodesLen;}"
|
||||
@ -3842,7 +3796,6 @@
|
||||
"testString": "assert((function() { var graph = [[0, 1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]]; return dfs(graph, 0);})().length === 2, 'The input graph <code>[[0, 1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]]</code> with a start node of <code>0</code> should return an array with two elements.');"
|
||||
}
|
||||
],
|
||||
"type": "waypoint",
|
||||
"releasedOn": "Feb 17, 2017",
|
||||
"solutions": [
|
||||
"function dfs(graph, root) { var stack = []; var tempV; var visited = []; var tempVNeighbors = []; stack.push(root); while (stack.length > 0) { tempV = stack.pop(); if (visited.indexOf(tempV) == -1) { visited.push(tempV); tempVNeighbors = graph[tempV]; for (var i = 0; i < tempVNeighbors.length; i++) { if (tempVNeighbors[i] == 1) { stack.push(i); }}}} return visited;}"
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -7,7 +7,6 @@
|
||||
"challenges": [
|
||||
{
|
||||
"title": "100 doors",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>There are 100 doors in a row that are all initially closed. You make 100 passes by the doors. The first time through, visit every door and 'toggle' the door (if the door is closed, open it; if it is open, close it). The second time, only visit every 2nd door (i.e., door #2, #4, #6, ...) and toggle it. The third time, visit every 3rd door (i.e., door #3, #6, #9, ...), etc., until you only visit the 100th door.</p>",
|
||||
"<p>Implement a function to determine the state of the doors after the last pass. Return the final result in an array, with only the door number included in the array if it is open.</p>"
|
||||
@ -51,7 +50,6 @@
|
||||
},
|
||||
{
|
||||
"title": "24 game",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>Implement a function that takes a string of four digits as its argument, with each digit from 1 ──► 9 (inclusive) with repetitions allowed, and returns an arithmetic expression that evaluates to the number 24. If no such solution exists, return \"no solution exists.\"</p>",
|
||||
"<p>Rules:</p>",
|
||||
@ -135,7 +133,6 @@
|
||||
},
|
||||
{
|
||||
"title": "9 billion names of God the integer",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>This task is a variation of the <a href=\"https://en.wikipedia.org/wiki/The Nine Billion Names of God#Plot_summary\" title=\"wp: The Nine Billion Names of God#Plot_summary\">short story by Arthur C. Clarke</a>.</p>",
|
||||
"<p>(Solvers should be aware of the consequences of completing this task.)</p>",
|
||||
@ -213,7 +210,6 @@
|
||||
},
|
||||
{
|
||||
"title": "ABC Problem",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>You are given a collection of ABC blocks (e.g., childhood alphabet blocks). There are 20 blocks with two letters on each block. A complete alphabet is guaranteed amongst all sides of the blocks. The sample collection of blocks:</p>",
|
||||
"<p>(B O)</p>",
|
||||
@ -300,7 +296,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Abundant, deficient and perfect number classifications",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>These define three classifications of positive integers based on their <a href=\"http://rosettacode.org/wiki/Proper divisors\" title=\"Proper divisors\">proper divisors</a>.</p>",
|
||||
"<p>Let $P(n)$ be the sum of the proper divisors of n where proper divisors are all positive integers n other than n itself.</p>",
|
||||
@ -355,7 +350,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Accumulator factory",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>Create a function that takes a single (numeric) argument and returns another function that is an accumulator. The returned accumulator function in turn also takes a single numeric argument, and returns the sum of all the numeric values passed in so far to that accumulator (including the initial value passed when the accumulator was created).</p>",
|
||||
"<p>Rules:</p>",
|
||||
@ -410,7 +404,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Ackermann function",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>The Ackermann function is a classic example of a recursive function, notable especially because it is not a primitive recursive function. It grows very quickly in value, as does the size of its call tree.</p>",
|
||||
"<p>The Ackermann function is usually defined as follows:</p>",
|
||||
@ -467,7 +460,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Align columns",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>Given a text file of many lines, where fields within a line are delineated by a single <code>$</code> character, write a program that aligns each column of fields by ensuring that words in each column are separated by at least one space. Further, allow for each word in a column to be either left justified, right justified, or center justified within its column.</p>",
|
||||
"<p>Use the following text to test your programs:</p>",
|
||||
@ -591,7 +583,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Amicable pairs",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"Two integers $N$ and $M$ are said to be <a href=\"https://en.wikipedia.org/wiki/Amicable numbers\" title=\"wp: Amicable numbers\">amicable pairs</a> if $N \\neq M$ and the sum of the <a href=\"http://rosettacode.org/wiki/Proper divisors\" title=\"Proper divisors\">proper divisors</a> of $N$ ($\\mathrm{sum}(\\mathrm{propDivs}(N))$) $= M$ as well as $\\mathrm{sum}(\\mathrm{propDivs}(M)) = N$.",
|
||||
"Example:",
|
||||
@ -664,7 +655,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Averages/Mode",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>Write a program to find the <a href=\"https://en.wikipedia.org/wiki/Mode (statistics)\" title=\"wp: Mode (statistics)\">mode</a> value of a collection.</p><p>The case where the collection is empty may be ignored. Care must be taken to handle the case where the mode is non-unique.</p><p>If it is not appropriate or possible to support a general collection, use a vector (array), if possible. If it is not appropriate or possible to support an unspecified value type, use integers.</p>"
|
||||
],
|
||||
@ -709,7 +699,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Averages/Pythagorean means",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p class='rosetta__paragraph'>Compute all three of the <a class='rosetta__link--wiki' href='https://en.wikipedia.org/wiki/Pythagorean means' title='wp: Pythagorean means'>Pythagorean means</a> of the set of integers <big>1</big> through <big>10</big> (inclusive).</p><p class='rosetta__paragraph'>Show that <big>$A(x_1,\\ldots,x_n) \\geq G(x_1,\\ldots,x_n) \\geq H(x_1,\\ldots,x_n)$</big> for this set of positive integers.</p> The most common of the three means, the <a class='rosetta__link--rosetta' href='http://rosettacode.org/wiki/Averages/Arithmetic mean' title='Averages/Arithmetic mean'>arithmetic mean</a>, is the sum of the list divided by its length: <big>$ A(x_1, \\ldots, x_n) = \\frac{x_1 + \\cdots + x_n}{n}$</big>The <a class='rosetta__link--wiki' href='https://en.wikipedia.org/wiki/Geometric mean' title='wp: Geometric mean'>geometric mean</a> is the $n$th root of the product of the list: <big>$ G(x_1, \\ldots, x_n) = \\sqrt[n]{x_1 \\cdots x_n} $</big>The <a class='rosetta__link--wiki' href='https://en.wikipedia.org/wiki/Harmonic mean' title='wp: Harmonic mean'>harmonic mean</a> is $n$ divided by the sum of the reciprocal of each item in the list: <big>$ H(x_1, \\ldots, x_n) = \\frac{n}{\\frac{1}{x_1} + \\cdots + \\frac{1}{x_n}} $</big>",
|
||||
"<p class='rosetta__paragraph'>Assume the input is an ordered array of all inclusive numbers.</p>",
|
||||
@ -769,7 +758,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Averages/Root mean square",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>Compute the <a href=\"https://en.wikipedia.org/wiki/Root mean square\" title=\"wp: Root mean square\">Root mean square</a> of the numbers 1 through 10 inclusive.</p>",
|
||||
"<p>The root mean square is also known by its initials RMS (or rms), and as the quadratic mean.</p><p>The RMS is calculated as the mean of the squares of the numbers, square-rooted:</p>",
|
||||
@ -811,7 +799,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Babbage problem",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p><a href=\"https://en.wikipedia.org/wiki/Charles_Babbage\" title=\"wp: Charles_Babbage\">Charles Babbage</a>, looking ahead to the sorts of problems his Analytical Engine would be able to solve, gave this example:</p>",
|
||||
"<blockquote>What is the smallest positive integer whose square ends in the digits 269,696?</blockquote>",
|
||||
@ -858,7 +845,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Balanced brackets",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>Determine whether a generated string of brackets is balanced; that is, whether it consists entirely of pairs of opening/closing brackets (in that order), none of which mis-nest.</p>",
|
||||
"Examples:",
|
||||
@ -993,7 +979,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Circles of given radius through two points",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>Given two points on a plane and a radius, usually two circles of given radius can be drawn through the points.</p>",
|
||||
"Exceptions:",
|
||||
@ -1083,7 +1068,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Closest-pair problem",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"Task:",
|
||||
"<p>Provide a function to find the closest two points among a set of given points in two dimensions, i.e. to solve the <a href=\"https://en.wikipedia.org/wiki/Closest pair of points problem\" title=\"wp: Closest pair of points problem\">Closest pair of points problem</a> in the planar case.</p><p>The straightforward solution is a O(n<sup>2</sup>) algorithm (which we can call brute-force algorithm); the pseudo-code (using indexes) could be simply:</p>",
|
||||
@ -1306,7 +1290,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Combinations",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"Task:",
|
||||
"<p>Given non-negative integers <big> m </big> and <big> n</big>, generate all size <big> m </big> <a href=\"http://mathworld.wolfram.com/Combination.html\" title=\"link: http://mathworld.wolfram.com/Combination.html\">combinations</a> of the integers from <big> 0</big> (zero) to <big> n-1 </big> in sorted order (each combination is sorted and the entire table is sorted).</p>",
|
||||
@ -1369,7 +1352,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Comma quibbling",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>Comma quibbling is a task originally set by Eric Lippert in his <a href=\"http://blogs.msdn.com/b/ericlippert/archive/2009/04/15/comma-quibbling.aspx\" title=\"link: http://blogs.msdn.com/b/ericlippert/archive/2009/04/15/comma-quibbling.aspx\">blog</a>.</p>",
|
||||
"Task:<p>Write a function to generate a string output which is the concatenation of input words from a list/sequence where:</p>",
|
||||
@ -1437,7 +1419,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Compare a list of strings",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>Given a <a href=\"https://en.wikipedia.org/wiki/List_(abstract_data_type)\" title=\"wp: List_(abstract_data_type)\">list</a> of arbitrarily many strings, implement a function for each of the following conditions:</p> test if they are all lexically equal",
|
||||
" test if every string is lexically less than the one after it (i.e. whether the list is in strict ascending order)"
|
||||
@ -1523,7 +1504,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Convert seconds to compound duration",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"Task:",
|
||||
"<p>Implement a function which:</p>",
|
||||
@ -1634,7 +1614,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Count occurrences of a substring",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"Task:",
|
||||
"<p>Create a function, or show a built-in function, to count the number of non-overlapping occurrences of a substring inside a string.</p><p>The function should take two arguments:</p>",
|
||||
@ -1689,7 +1668,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Count the coins",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>There are four types of common coins in <a href=\"https://en.wikipedia.org/wiki/United_States\" title=\"link: https://en.wikipedia.org/wiki/United_States\">US</a> currency:</p>",
|
||||
"quarters (25 cents)",
|
||||
@ -1742,7 +1720,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Cramer's rule",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>In <a href=\"https://en.wikipedia.org/wiki/linear algebra\" title=\"wp: linear algebra\">linear algebra</a>, <a href=\"https://en.wikipedia.org/wiki/Cramer's rule\" title=\"wp: Cramer's rule\">Cramer's rule</a> is an explicit formula for the solution of a <a href=\"https://en.wikipedia.org/wiki/system of linear equations\" title=\"wp: system of linear equations\">system of linear equations</a> with as many equations as unknowns, valid whenever the system has a unique solution. It expresses the solution in terms of the determinants of the (square) coefficient matrix and of matrices obtained from it by replacing one column by the vector of right hand sides of the equations.</p>",
|
||||
"<p>Given</p>",
|
||||
@ -1819,7 +1796,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Date format",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"Task:",
|
||||
"<p>Return an array with the current date in the formats:</p>",
|
||||
@ -1881,7 +1857,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Date manipulation",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"Task:",
|
||||
"<p>Given a date string in EST, output the given date as a string with 12 hours added to the time. </p>",
|
||||
@ -1960,7 +1935,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Day of the week",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>A company decides that whenever Xmas falls on a Sunday they will give their workers all extra paid holidays so that, together with any public holidays, workers will not have to work the following week (between the 25th of December and the first of January).</p>",
|
||||
"<p>Task:</p>",
|
||||
@ -2011,7 +1985,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Deal cards for FreeCell",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>Free Cell is the solitaire card game that Paul Alfille introduced to the PLATO system in 1978. Jim Horne, at Microsoft, changed the name to FreeCell and reimplemented the game for <a href=\"http://rosettacode.org/wiki/DOS\" title=\"DOS\">DOS</a>, then <a href=\"http://rosettacode.org/wiki/Windows\" title=\"Windows\">Windows</a>. </p>",
|
||||
"<p>This version introduced 32000 numbered deals. (The <a href=\"http://www.solitairelaboratory.com/fcfaq.html\" title=\"link: http://www.solitairelaboratory.com/fcfaq.html\">FreeCell FAQ</a> tells this history.)</p><p>As the game became popular, Jim Horne disclosed <a href=\"http://www.solitairelaboratory.com/mshuffle.txt\" title=\"link: http://www.solitairelaboratory.com/mshuffle.txt\">the algorithm</a>, and other implementations of FreeCell began to reproduce the Microsoft deals. </p>",
|
||||
@ -2128,7 +2101,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Deepcopy",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"Task:",
|
||||
"<p>Write a function that returns a deep copy of a given object.</p>",
|
||||
@ -2196,7 +2168,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Define a primitive data type",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"Task:",
|
||||
"<p>Define a type that behaves like an integer but has a lowest valid value of 1 and a highest valid value of 10.</p>",
|
||||
@ -2288,7 +2259,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Department Numbers",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>There is a highly organized city that has decided to assign a number to each of their departments:</p>",
|
||||
"Police department",
|
||||
@ -2374,7 +2344,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Discordian date",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"Task:",
|
||||
"<p>Convert a given date from the <a href=\"https://en.wikipedia.org/wiki/Gregorian calendar\" title=\"wp: Gregorian calendar\">Gregorian calendar</a> to the <a href=\"https://en.wikipedia.org/wiki/Discordian calendar\" title=\"wp: Discordian calendar\">Discordian calendar</a>.</p>"
|
||||
@ -2437,7 +2406,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Element-wise operations",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>Implement basic element-wise matrix-matrix and scalar-matrix operations.</p><p>Implement:</p>",
|
||||
"<p>::* addition</p>",
|
||||
@ -2504,7 +2472,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Emirp primes",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>An emirp (prime spelled backwards) are primes that when reversed (in their decimal representation) are a different prime.</p>",
|
||||
"<p>Write a function that should be able to : Show the first <b>n</b> eprimes numbers.Show the eprimes numbers in a range.Show the number of eprimes in a range.Show the <b>n<sup>th</sup></b> eprimes number.<p>The function should have two parameters. The first will receive <b>n</b> or the range as an array. The second will receive a boolean, that specifies if the function returns the eprimes as an array or a single number(the number of primes in the range or the <b>n<sup>th</sup></b> prime). According to the parameters the function should return an array or a number."
|
||||
@ -2555,7 +2522,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Entropy",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"Task:",
|
||||
"<p>Calculate the Shannon entropy H of a given input string.</p><p>Given the discreet random variable $X$ that is a string of $N$ \"symbols\" (total characters) consisting of $n$ different characters (n=2 for binary), the Shannon entropy of X in bits/symbol is :</p>",
|
||||
@ -2614,7 +2580,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Equilibrium index",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>An equilibrium index of a sequence is an index into the sequence such that the sum of elements at lower indices is equal to the sum of elements at higher indices.</p>",
|
||||
"<p>For example, in a sequence <big>$A$</big>:</p><p>:::: <big>$A_0 = -7$</big></p>",
|
||||
@ -2689,7 +2654,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Ethiopian multiplication",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>Ethiopian multiplication is a method of multiplying integers using only addition, doubling, and halving.</p>",
|
||||
"<p>Method: </p>",
|
||||
@ -2783,7 +2747,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Euler method",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>Euler's method numerically approximates solutions of first-order ordinary differential equations (ODEs) with a given initial value. It is an explicit method for solving initial value problems (IVPs), as described in <a href=\"https://en.wikipedia.org/wiki/Euler method\" title=\"wp: Euler method\">the wikipedia page</a>.</p><p>The ODE has to be provided in the following form:</p><p>:: <big>$\\frac{dy(t)}{dt} = f(t,y(t))$</big></p><p>with an initial value</p><p>:: <big>$y(t_0) = y_0$</big></p><p>To get a numeric solution, we replace the derivative on the LHS with a finite difference approximation:</p><p>:: <big>$\\frac{dy(t)}{dt} \\approx \\frac{y(t+h)-y(t)}{h}$</big></p><p>then solve for $y(t+h)$:</p><p>:: <big>$y(t+h) \\approx y(t) + h \\, \\frac{dy(t)}{dt}$</big></p><p>which is the same as</p><p>:: <big>$y(t+h) \\approx y(t) + h \\, f(t,y(t))$</big></p><p>The iterative solution rule is then:</p><p>:: <big>$y_{n+1} = y_n + h \\, f(t_n, y_n)$</big></p><p>where <big>$h$</big> is the step size, the most relevant parameter for accuracy of the solution. A smaller step size increases accuracy but also the computation cost, so it has always has to be hand-picked according to the problem at hand.</p>",
|
||||
"<p>Example: Newton's Cooling Law</p><p>Newton's cooling law describes how an object of initial temperature <big>$T(t_0) = T_0$</big> cools down in an environment of temperature <big>$T_R$</big>:</p><p>:: <big>$\\frac{dT(t)}{dt} = -k \\, \\Delta T$</big></p>",
|
||||
@ -2848,7 +2811,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Evaluate binomial coefficients",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>Write a function to calculate the binomial coefficient for the given value of n and k.</p><p>This formula is recommended:</p>",
|
||||
"$\\binom{n}{k} = \\frac{n!}{(n-k)!k!} = \\frac{n(n-1)(n-2)\\ldots(n-k+1)}{k(k-1)(k-2)\\ldots 1}$"
|
||||
@ -2902,7 +2864,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Execute a Markov algorithm",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"Task:",
|
||||
"<p>Create an interpreter for a <a href=\"https://en.wikipedia.org/wiki/Markov algorithm\" title=\"wp: Markov algorithm\">Markov Algorithm</a>.</p><p>Rules have the syntax:</p>",
|
||||
@ -3059,7 +3020,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Execute Brain****",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>Write a function to implement a Brain**** interpreter. The function will take a string as a parameter and should return a string as the output. More details are given below : </p>",
|
||||
"<p>RCBF is a set of <a href=\"http://rosettacode.org/wiki/Brainf***\" title=\"Brainf***\">Brainf***</a> compilers and interpreters written for Rosetta Code in a variety of languages.</p><p>Below are links to each of the versions of RCBF.</p><p>An implementation need only properly implement the following instructions:</p>",
|
||||
@ -3135,7 +3095,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Extensible prime generator",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>Write a generator of prime numbers, in order, that will automatically adjust to accommodate the generation of any reasonably high prime.</p> The generator should be able to : Show the first <b>n</b> prime numbers.Show the prime numbers in a range.Show the number of primes in a range.Show the <b>n<sup>th</sup></b> prime number.<p>The function should have two parameters. The first will receive <b>n</b> or the range as an array. The second will receive a boolean, that specifies if the function returns the prime numbers as an array or a single number(the number of primes in the range or the <b>n<sup>th</sup></b> prime). According to the parameters the function should return an array."
|
||||
],
|
||||
@ -3184,7 +3143,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Factorial",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>Write a function to return the factorial of a number.</p>",
|
||||
"<p>Factorial of a number is given by : </p>",
|
||||
@ -3245,7 +3203,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Factors of a Mersenne number",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>A Mersenne number is a number in the form of 2<sup>P</sup>-1.</p><p>If P is prime, the Mersenne number may be a Mersenne prime</p>",
|
||||
"<p>(if P is not prime, the Mersenne number is also not prime).</p><p>In the search for Mersenne prime numbers it is advantageous to eliminate exponents by finding a small factor before starting a, potentially lengthy, <a href=\"http://rosettacode.org/wiki/Lucas-Lehmer test\" title=\"Lucas-Lehmer test\">Lucas-Lehmer test</a>.</p><p>There are very efficient algorithms for determining if a number divides 2<sup>P</sup>-1 (or equivalently, if 2<sup>P</sup> mod (the number) = 1).</p>",
|
||||
@ -3324,7 +3281,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Factors of an integer",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>Write a function that returns the factors of a positive integer.</p><p>These factors are the positive integers by which the number being factored can be divided to yield a positive integer result.</p>",
|
||||
"///"
|
||||
@ -3372,7 +3328,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Farey sequence",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>Write a function that returns the Farey sequence of order n. The function should have one parameter that is n. It should return the sequence as an array. Read the following for more details : </p><p>The <a href=\"https://en.wikipedia.org/wiki/Farey sequence\" title=\"wp: Farey sequence\">Farey sequence</a> F<sub>n</sub> of order n is the sequence of completely reduced fractions between 0 and 1 which, when in lowest terms, have denominators less than or equal to n, arranged in order of increasing size.</p><p>The Farey sequence is sometimes incorrectly called a Farey series.</p>",
|
||||
"<p>Each Farey sequence:</p>",
|
||||
@ -3433,7 +3388,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Fibonacci n-step number sequences",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>Write a function to generate Fibonacci n-step number sequences and Lucas sequences. The first parameter will be n. The second parameter will be the number of elements to be returned. The third parameter will specify whether to output the Fibonacci sequence or the Lucas sequence. If the parameter is \"f\" then return the Fibonacci sequence and if it is \"l\", then return the Lucas sequence. The sequences must be returned as an array. More details are given below : </p><p>These number series are an expansion of the ordinary <a href=\"http://rosettacode.org/wiki/Fibonacci sequence\" title=\"Fibonacci sequence\">Fibonacci sequence</a> where:</p>",
|
||||
"For $n = 2$ we have the Fibonacci sequence; with initial values $[1, 1]$ and $F_k^2 = F_{k-1}^2 + F_{k-2}^2$",
|
||||
@ -3530,7 +3484,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Fibonacci sequence",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>Write a function to generate the <big> n<sup>th</sup> </big> Fibonacci number.</p>",
|
||||
"///<p>The <big> n<sup>th</sup> </big> Fibonacci number is given by :",
|
||||
@ -3584,7 +3537,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Fibonacci word",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>Write a function to return the Fibonacci Words upto N. N will be provided as a parameter to the function. The function should return an array of objects. The objects should be of the form : { N: 1, Length: 1, Entropy: 0, Word: '1' }. More details are given below : </p><p>The Fibonacci Word may be created in a manner analogous to the Fibonacci Sequence <a href=\"http://hal.archives-ouvertes.fr/docs/00/36/79/72/PDF/The_Fibonacci_word_fractal.pdf\" title=\"link: http://hal.archives-ouvertes.fr/docs/00/36/79/72/PDF/The_Fibonacci_word_fractal.pdf\">as described here</a>:</p><p>Define F_Word<sub>1</sub> as 1</p>",
|
||||
"<p>Define F_Word<sub>2</sub> as 0</p>",
|
||||
@ -3638,7 +3590,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Hailstone sequence",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>The Hailstone sequence of numbers can be generated from a starting positive integer, n by:</p>",
|
||||
" If n is 1 then the sequence ends.",
|
||||
@ -3690,7 +3641,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Happy numbers",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>A happy number is defined by the following process:</p>",
|
||||
"<p>Starting with any positive integer, replace the number by the sum of the squares of its digits, and repeat the process until the number equals 1 (where it will stay), or it loops endlessly in a cycle which does not include 1. Those numbers for which this process ends in 1 are happy numbers, while those that do not end in 1 are unhappy numbers.</p>",
|
||||
@ -3773,7 +3723,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Harshad or Niven series",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>The <a href=\"http://mathworld.wolfram.com/HarshadNumber.html\" title=\"link: http://mathworld.wolfram.com/HarshadNumber.html\">Harshad</a> or Niven numbers are positive integers ≥ 1 that are divisible by the sum of their digits.</p><p>For example, 42 is a <a href=\"http://rosettacode.org/wiki/oeis:A005349\" title=\"oeis:A005349\">Harshad number</a> as 42 is divisible by (4 + 2) without remainder.</p>",
|
||||
"Assume that the series is defined as the numbers in increasing order.",
|
||||
@ -3824,7 +3773,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Hash from two arrays",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"Task:",
|
||||
"<p>Using two Arrays of equal length, create a Hash object where the elements from one array (the keys) are linked to the elements of the other (the values)</p>",
|
||||
@ -3903,7 +3851,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Hash join",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>An <a href=\"https://en.wikipedia.org/wiki/Join_(SQL)#Inner_join\" title=\"wp: Join_(SQL)#Inner_join\">inner join</a> is an operation that combines two data tables into one table, based on matching column values. The simplest way of implementing this operation is the <a href=\"https://en.wikipedia.org/wiki/Nested loop join\" title=\"wp: Nested loop join\">nested loop join</a> algorithm, but a more scalable alternative is the <a href=\"https://en.wikipedia.org/wiki/hash join\" title=\"wp: hash join\">hash join</a> algorithm.</p>",
|
||||
"<p>Implement the \"hash join\" algorithm, and demonstrate that it passes the test-case listed below.</p><p>You should represent the tables as data structures that feel natural in your programming language.</p>",
|
||||
@ -4123,7 +4070,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Heronian triangles",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p><a href=\"https://en.wikipedia.org/wiki/Heron's formula\" title=\"wp: Heron's formula\">Hero's formula</a> for the area of a triangle given the length of its three sides <big> a,</big> <big>b,</big> and <big>c</big> is given by:</p><p><big>$$A = \\sqrt{s(s-a)(s-b)(s-c)},$$</big></p><p>where <big>s</big> is half the perimeter of the triangle; that is,</p><p><big>$$s=\\frac{a+b+c}{2}.$$</big></p>",
|
||||
"<p><a href=\"http://www.had2know.com/academics/heronian-triangles-generator-calculator.html\" title=\"link: http://www.had2know.com/academics/heronian-triangles-generator-calculator.html\">Heronian triangles</a> are triangles whose sides and area are all integers.</p>",
|
||||
@ -4190,7 +4136,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Hofstadter Figure-Figure sequences",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>These two sequences of positive integers are defined as:</p>",
|
||||
"<p><big>$$R(1)=1\\ ;\\ S(1)=2 \\\\R(n)=R(n-1)+S(n-1), \\quad n>1.$$</big></p>",
|
||||
@ -4287,7 +4232,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Hofstadter Q sequence",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>The <a href=\"https://en.wikipedia.org/wiki/Hofstadter_sequence#Hofstadter_Q_sequence\" title=\"wp: Hofstadter_sequence#Hofstadter_Q_sequence\">Hofstadter Q sequence</a> is defined as:</p>",
|
||||
"<p>$Q(1)=Q(2)=1, \\\\ Q(n)=Q\\big(n-Q(n-1)\\big)+Q\\big(n-Q(n-2)), \\quad n>2.$</p>",
|
||||
@ -4348,7 +4292,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Sailors, coconuts and a monkey problem",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
" <p>",
|
||||
" Five sailors are shipwrecked on an island and",
|
||||
@ -4452,7 +4395,6 @@
|
||||
},
|
||||
{
|
||||
"title": "SEDOLs",
|
||||
"type": "Waypoint",
|
||||
"null": [],
|
||||
"description": [
|
||||
" Task:",
|
||||
@ -4534,7 +4476,6 @@
|
||||
},
|
||||
{
|
||||
"title": "S-Expressions",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>",
|
||||
"<a href=\"https://en.wikipedia.org/wiki/S-Expression\" title=\"wp: S-Expression\">S-Expressions</a> are one convenient way to parse and store data.",
|
||||
@ -4620,7 +4561,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Taxicab numbers",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"A <a href=\"https://en.wikipedia.org/wiki/Hardy–Ramanujan number\" title=\"wp: Hardy–Ramanujan number\">taxicab number</a>",
|
||||
" (the definition that is being used here) is a positive integer that can be expressed as the sum of two positive cubes in more than one way.",
|
||||
@ -4700,7 +4640,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Tokenize a string with escaping",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>",
|
||||
"Write a function or program that can split a string at each non-escaped occurrence of a separator character.",
|
||||
@ -4776,7 +4715,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Topological sort",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>",
|
||||
"Given a mapping between items, and items they depend on, a ",
|
||||
@ -4919,7 +4857,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Top rank per group",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"Task:",
|
||||
"<p>Find the top N ranked data in each group, where N is provided as a parameter. Name of the rank and the group are also provided as parameter.</p>",
|
||||
@ -5041,7 +4978,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Towers of Hanoi",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
" Task:",
|
||||
"<p>Solve the <a href=\"https://en.wikipedia.org/wiki/Towers_of_Hanoi\" title=\"wp: Towers_of_Hanoi\">Towers of Hanoi</a> problem.</p>",
|
||||
@ -5106,7 +5042,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Vector cross product",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"A vector is defined as having three dimensions as being represented by an ordered collection of three numbers: (X, Y, Z).",
|
||||
"<p>",
|
||||
@ -5160,7 +5095,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Vector dot product",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>",
|
||||
"A vector is defined as having three dimensions as being represented by an ordered collection of three numbers: (X, Y, Z).",
|
||||
@ -5223,7 +5157,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Word wrap",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>",
|
||||
"Even today, with proportional fonts and complex layouts, there are still",
|
||||
@ -5314,7 +5247,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Y combinator",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>",
|
||||
"In strict ",
|
||||
@ -5396,7 +5328,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Zeckendorf number representation",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"<p>",
|
||||
"Just as numbers can be represented in a",
|
||||
@ -5471,7 +5402,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Zhang-Suen thinning algorithm",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"This is an algorithm used to thin a black and white i.e. one bit per pixel images.",
|
||||
"For example, with an input image of:",
|
||||
@ -5652,7 +5582,6 @@
|
||||
},
|
||||
{
|
||||
"title": "Zig-zag matrix",
|
||||
"type": "Waypoint",
|
||||
"description": [
|
||||
"A ''zig-zag'' array is a square arrangement of the first ",
|
||||
"$N^2$ integers, where the",
|
||||
|
@ -19,9 +19,7 @@
|
||||
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen.",
|
||||
"You can get feedback on your project by sharing it with your friends on Facebook."
|
||||
],
|
||||
"challengeSeed": [],
|
||||
"tests": [],
|
||||
"type": "zipline",
|
||||
"challengeType": 3,
|
||||
"isRequired": false,
|
||||
"translations": {
|
||||
@ -73,9 +71,7 @@
|
||||
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen.",
|
||||
"You can get feedback on your project by sharing it with your friends on Facebook."
|
||||
],
|
||||
"challengeSeed": [],
|
||||
"tests": [],
|
||||
"type": "zipline",
|
||||
"challengeType": 3,
|
||||
"isRequired": false,
|
||||
"translations": {
|
||||
@ -116,9 +112,7 @@
|
||||
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen.",
|
||||
"You can get feedback on your project by sharing it with your friends on Facebook."
|
||||
],
|
||||
"challengeSeed": [],
|
||||
"tests": [],
|
||||
"type": "zipline",
|
||||
"challengeType": 3,
|
||||
"isRequired": false,
|
||||
"translations": {
|
||||
@ -173,11 +167,9 @@
|
||||
"Once you've finished implementing these user stories, click the \"I've completed this challenge\" button and enter the URLs for both your GitHub repository and your live app running on Glitch.",
|
||||
"You can get feedback on your project by sharing it with your friends on Facebook."
|
||||
],
|
||||
"challengeSeed": [],
|
||||
"tests": [],
|
||||
"isRequired": true,
|
||||
"releasedOn": "January 1, 2016",
|
||||
"type": "basejump",
|
||||
"challengeType": 4,
|
||||
"translations": {
|
||||
"es": {
|
||||
@ -208,9 +200,7 @@
|
||||
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen.",
|
||||
"You can get feedback on your project by sharing it with your friends on Facebook."
|
||||
],
|
||||
"challengeSeed": [],
|
||||
"tests": [],
|
||||
"type": "zipline",
|
||||
"challengeType": 3,
|
||||
"isRequired": false,
|
||||
"translations": {
|
||||
@ -248,9 +238,7 @@
|
||||
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen.",
|
||||
"You can get feedback on your project by sharing it with your friends on Facebook."
|
||||
],
|
||||
"challengeSeed": [],
|
||||
"tests": [],
|
||||
"type": "zipline",
|
||||
"challengeType": 3,
|
||||
"isRequired": false,
|
||||
"translations": {
|
||||
@ -291,9 +279,7 @@
|
||||
"You can get feedback on your project by sharing it with your friends on Facebook."
|
||||
],
|
||||
"releasedOn": "January 1, 2016",
|
||||
"challengeSeed": [],
|
||||
"tests": [],
|
||||
"type": "zipline",
|
||||
"isRequired": false,
|
||||
"challengeType": 3,
|
||||
"translations": {
|
||||
@ -347,9 +333,7 @@
|
||||
"You can get feedback on your project by sharing it with your friends on Facebook."
|
||||
],
|
||||
"releasedOn": "January 1, 2016",
|
||||
"challengeSeed": [],
|
||||
"tests": [],
|
||||
"type": "zipline",
|
||||
"isRequired": false,
|
||||
"challengeType": 3,
|
||||
"translations": {
|
||||
@ -410,9 +394,7 @@
|
||||
"You can get feedback on your project by sharing it with your friends on Facebook."
|
||||
],
|
||||
"releasedOn": "January 1, 2016",
|
||||
"challengeSeed": [],
|
||||
"tests": [],
|
||||
"type": "zipline",
|
||||
"isRequired": false,
|
||||
"challengeType": 3,
|
||||
"translations": {
|
||||
@ -478,9 +460,7 @@
|
||||
"You can get feedback on your project by sharing it with your friends on Facebook."
|
||||
],
|
||||
"releasedOn": "January 1, 2016",
|
||||
"challengeSeed": [],
|
||||
"tests": [],
|
||||
"type": "zipline",
|
||||
"isRequired": false,
|
||||
"challengeType": 3,
|
||||
"translations": {
|
||||
@ -543,9 +523,7 @@
|
||||
"When you are finished, click the \"I've completed this challenge\" button and include a link to your Glitch App.",
|
||||
"You can get feedback on your project by sharing it with your friends on Facebook."
|
||||
],
|
||||
"challengeSeed": [],
|
||||
"tests": [],
|
||||
"type": "zipline",
|
||||
"challengeType": 3,
|
||||
"isRequired": false,
|
||||
"releasedOn": "January 1, 2016"
|
||||
@ -564,11 +542,9 @@
|
||||
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. ",
|
||||
"You can get feedback on your project by sharing it with your friends on Facebook."
|
||||
],
|
||||
"challengeSeed": [],
|
||||
"tests": [],
|
||||
"isRequired": false,
|
||||
"releasedOn": "January 1, 2016",
|
||||
"type": "zipline",
|
||||
"challengeType": 3,
|
||||
"translations": {
|
||||
"es": {
|
||||
@ -605,11 +581,9 @@
|
||||
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen. ",
|
||||
"You can get feedback on your project by sharing it with your friends on Facebook."
|
||||
],
|
||||
"challengeSeed": [],
|
||||
"tests": [],
|
||||
"isRequired": false,
|
||||
"releasedOn": "January 1, 2016",
|
||||
"type": "zipline",
|
||||
"challengeType": 3,
|
||||
"translations": {
|
||||
"es": {
|
||||
@ -643,9 +617,7 @@
|
||||
"Once you've finished implementing these user stories, click the \"I've completed this challenge\" button and enter the URLs for both your GitHub repository and your live app running on Heroku.",
|
||||
"You can get feedback on your project by sharing it with your friends on Facebook."
|
||||
],
|
||||
"challengeSeed": [],
|
||||
"tests": [],
|
||||
"type": "basejump",
|
||||
"challengeType": 4,
|
||||
"translations": {
|
||||
"es": {
|
||||
@ -680,9 +652,7 @@
|
||||
"Once you've finished implementing these user stories, click the \"I've completed this challenge\" button and enter the URLs for both your GitHub repository and your live app running on Heroku.",
|
||||
"You can get feedback on your project by sharing it with your friends on Facebook."
|
||||
],
|
||||
"challengeSeed": [],
|
||||
"tests": [],
|
||||
"type": "basejump",
|
||||
"challengeType": 4,
|
||||
"translations": {
|
||||
"es": {
|
||||
@ -719,11 +689,7 @@
|
||||
"Once you've finished implementing these user stories, click the \"I've completed this challenge\" button and enter the URLs for both your GitHub repository and your live app running on Heroku.",
|
||||
"You can get feedback on your project by sharing it with your friends on Facebook."
|
||||
],
|
||||
"challengeSeed": [
|
||||
"Gei7QfPmcMw"
|
||||
],
|
||||
"tests": [],
|
||||
"type": "basejump",
|
||||
"challengeType": 4,
|
||||
"isRequired": true,
|
||||
"translations": {
|
||||
@ -757,11 +723,7 @@
|
||||
"Once you've finished implementing these user stories, click the \"I've completed this challenge\" button and enter the URLs for both your GitHub repository and your live app running on Heroku.",
|
||||
"You can get feedback on your project by sharing it with your friends on Facebook."
|
||||
],
|
||||
"challengeSeed": [
|
||||
"CENs50cnRgM"
|
||||
],
|
||||
"tests": [],
|
||||
"type": "basejump",
|
||||
"challengeType": 4,
|
||||
"isRequired": true,
|
||||
"translations": {
|
||||
@ -797,12 +759,7 @@
|
||||
"<strong>User Story:</strong> As an authenticated user, if I don't like the options on a poll, I can create a new option.",
|
||||
"Once you've finished implementing these user stories, click the \"I've completed this challenge\" button and enter the URLs for both your GitHub repository and your live app running on Heroku.",
|
||||
"You can get feedback on your project by sharing it with your friends on Facebook."
|
||||
],
|
||||
"challengeSeed": [
|
||||
"JBKnbY_fdg4"
|
||||
],
|
||||
"tests": [],
|
||||
"type": "basejump",
|
||||
],"tests": [],
|
||||
"challengeType": 4,
|
||||
"isRequired": true,
|
||||
"translations": {
|
||||
@ -840,9 +797,7 @@
|
||||
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen.",
|
||||
"You can get feedback on your project by sharing it with your friends on Facebook."
|
||||
],
|
||||
"challengeSeed": [],
|
||||
"tests": [],
|
||||
"type": "zipline",
|
||||
"challengeType": 3,
|
||||
"isRequired": false
|
||||
},
|
||||
@ -863,9 +818,7 @@
|
||||
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen.",
|
||||
"You can get feedback on your project by sharing it with your friends on Facebook."
|
||||
],
|
||||
"challengeSeed": [],
|
||||
"tests": [],
|
||||
"type": "zipline",
|
||||
"challengeType": 3,
|
||||
"isRequired": false
|
||||
}
|
||||
|
Reference in New Issue
Block a user