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
| # Test cases used | |
| # | |
| # DOWN LEFT | |
| # 3 | |
| # --- | |
| # -m- | |
| # p-- | |
| # UP RIGHT | |
| # 3 |
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
| # Print the numbers from 1 to 100, except for multiples of 3 print "Fizz", for multiples of 5 print "Buzz", | |
| # and for multiples of 3 and 5 print "FizzBuzz". | |
| # Ex: | |
| # 1 | |
| # 2 | |
| # Fizz | |
| # 4 | |
| # Buzz | |
| # Fizz | |
| # 7 |
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
| // hashtable.hpp | |
| class HashTable { | |
| public: | |
| struct HashTable::HashEntry* insert(int); | |
| struct HashEntry { | |
| // Some stuff | |
| }; | |
| }; |
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
| require "test/unit" | |
| # Write a function called numPizzas, that takes the number of people present, | |
| # the number of slices in a pizza, and the time of day, and returns the | |
| # number of pizzas to buy (as a whole integer). | |
| # | |
| # Spec: | |
| # Signature: int numPizzas(int numPeople, int slicesPerPizza, int time) | |
| # Time is an int on 24-hour clock (0-23), e.g. 8 = 8am, 14 = 2pm | |
| # Between 11am - 11pm: 2 slices per person, else 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
| def sumDouble(ary); ary.map{|i| i*2}.inject(&:+); 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
| static int | |
| list_remove(node* root, node* n) { | |
| node* temp = (node*) malloc(sizeof(node)); | |
| temp = root; | |
| node* garbage = (node*) malloc(sizeof(node)); | |
| int found = -1; | |
| while (temp) { | |
| if (temp->next->val == n->val) { | |
| garbage = temp->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
| @fadeWith = (sound, duration) -> | |
| return @ if !supported | |
| @fadeOut duration, -> | |
| @stop() | |
| sound.play().fadeIn(duration) | |
| return @ |
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
| source 'http://rubygems.org' | |
| gem "rake", "~> 0.9.2.2" | |
| gem "uglifier", "~> 1.2.6" | |
| gem "listen", "~> 0.4.7" |
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 scrollTo(id) { | |
| $('html,body').animate({scrollTop: $("#" + id).offset().top}, 'slow'); | |
| } |
NewerOlder