This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func add(x, y) { | |
let p1 = {x: x, y: y} | |
let points = array(); | |
for (let i = 0; i < points.length; i++) { | |
let p2 = points[i]; | |
if (p2.x == p1.x && p2.y == p1.y) { | |
continue; | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "RKStudioOrderedTask", | |
"name": "Survey", | |
"identifier": "Survey", | |
"rkVersion": 1, | |
"steps": [ | |
{ | |
"type": "FormStep", | |
"text": "", | |
"title": "", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "RKStudioOrderedTask", | |
"name": "Survey", | |
"identifier": "Survey", | |
"rkVersion": 2, | |
"steps": [ | |
{ | |
"type": "QuestionStep", | |
"text": "Display When Expanded", | |
"title": "Text Choice", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "RKStudioOrderedTask", | |
"name": "Survey", | |
"identifier": "Survey", | |
"steps": [ | |
{ | |
"type": "QuestionStep", | |
"text": "Display When Expanded", | |
"title": "Text Choice", | |
"identifier": "New Step 1", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "RKStudioNavigableOrderedTask", | |
"name": "Survey", | |
"identifier": "Survey", | |
"steps": [ | |
{ | |
"type": "QuestionStep", | |
"text": "Either Skip or Answer", | |
"title": "Navigation Rule #1", | |
"identifier": "New Step 1", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var addTwoNumbers2 = function(l1, l2, carry) { | |
var sum = carry | |
var hasNext = carry != 0 | |
var l1Next = null | |
var l2Next = null | |
if (l1 != null) { | |
sum += l1.val | |
hasNext = true | |
l1Next = l1.next | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Cache { | |
constructor() { | |
this.theCache = {} | |
} | |
setImageById(id, image) { | |
let numberOfImages = Object.keys(this.cache).length | |
if (numberOfImages > 50) { | |
let keyOfOldest; | |
for(key in this.theCache) { | |
if (!keyOfOldest) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function findMinFromTree(node) { | |
let minValue = node.value | |
let minArray = [minValue] | |
-------------------------------------------------------------- | |
if (node.left) { | |
minArray.concat(findMinFromTree(node.left)) | |
} | |
if (node.right) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Cache { | |
constructor() { | |
this.theCache = {} | |
} | |
setImageById(id, image) { | |
let numberOfImages = Object.keys(this.cache).length | |
if (numberOfImages > 50) { | |
let keyOfOldest; | |
for(key in this.theCache) { | |
if (!keyOfOldest) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Node { | |
Node next; | |
object val; | |
public Node(object val) { | |
this.val = val | |
} | |
} | |
public class LinkedList { | |
NewerOlder