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
/* | |
Complete this JS class of a 1 dimensional wall for us to shoot random | |
paint balls at. | |
We want to be able to fire paint balls at a given position and ask the wall | |
if it has been 100% covered by paint. | |
You cannot change any code already written, you can only add to it. This | |
includes the constructor parameter, method names and method parameters. | |
*/ |
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
//Problem: | |
// -There are X columns | |
// -There are Y rows | |
// -People in different areas want to meet in 1 location | |
// -Input: array of points | |
// -Find an intersection which minimizes the total walking distance of all people | |
// -Data structure for output is an array | |
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 Sudoku | |
def initialize(board_string) | |
@board_string = board_string | |
@board = board_string.split("").map(&:to_i) | |
@blocks = [ @block_012 = [0, 1, 2], @block_345 = [3, 4, 5], @block_678 = [6, 7, 8] ] | |
end | |
# INPUT: index | |
# OUTPUT: two-coordinate array | |
def index_to_coord(index) |
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
def CoinDeterminer(num) | |
return num if num < 5 | |
count = num / 11 | |
if (num%11).even? | |
return count + 2 | |
else | |
return count + 1 | |
end | |
end |
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
#Bubble Sort | |
def bubblesort(list) | |
0.upto(list.size - 2) do |current| | |
if list[current] > list[current+1] | |
list[current], list[current+1] = list[current+1], list[current] | |
end | |
end | |
list | |
end |
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
$(document).ready(function() { | |
$("body").on("click", "#signup", function(event){ | |
event.preventDefault(); | |
$target = $(event.target); | |
$.ajax({ | |
type: "GET", | |
url: "/signup", | |
}).done(function(response){ | |
$(".container").replaceWith(response); | |
}) |