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 distance(a,b) | |
words = "I am a good girl".split(/\W+/) | |
a_found = false | |
b_found = false | |
prev = nil | |
words.each_with_index do |word, index| | |
if word == a |
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 product_max(a) | |
max_so_far = 1 | |
min_so_far = 1 | |
max = 1 | |
a.each do |i| |
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 isomorphic(a,b) | |
if a.length == 0 && b.length == 0 | |
true | |
elsif a.length != b.length | |
false | |
else | |
a_stru = b_stru = Hash.new{|hash, key| hash[key] =[] } | |
b_stru = Hash.new{|hash, key| hash[key] =[] } |
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 max_subarray(a) | |
max = - Float::INFINITY | |
max_at = [] | |
sum = 0 | |
sum_at = [] | |
a.each_with_index do |e, i| |
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
<?php | |
$style = theme_get_setting('style'); | |
switch ($style) { | |
case 1: | |
drupal_add_css(drupal_get_path('theme', 'current') . '/css/style1.css', array('group' => CSS_THEME, 'weight' => 100, 'type' => 'file')); | |
break; | |
case 2: | |
drupal_add_css(drupal_get_path('theme', 'current') . '/css/style2.css', array('group' => CSS_THEME, 'weight' => 100, 'type' => 'file')); |
NewerOlder