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
<div class="row "> | |
<div class="field"> | |
<%= f.label :start_time %> | |
<%= f.time_select :start_time, ignore_date: true %> | |
</div> | |
</div> |
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
language: ruby | |
rvm: | |
- 2.3.0 | |
env: | |
- CI_REPORTS=shippable/testresults COVERAGE_REPORTS=shippable/codecoverage | |
before_install: | |
- sudo apt-get -y update | |
- sudo apt-get -y install libpq-dev | |
before_script: | |
# ensure the test output and coverage dirs are created |
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) | |
a.split('').zip(b.split('')).select{|a,b| a!=b}.count | |
end | |
def min_differences(a,b) | |
distances = (0..(b.length - a.length)).map do |index| | |
b_sub = b[index...a.length+index] | |
distance(a,b_sub) | |
end | |
distances.min |
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 permutations(string) | |
permutations = string.split('').permutation.map(&:join).uniq | |
end | |
def lucky_strings(string) | |
permutations(string).select{|s| s.squeeze == s}.count | |
end | |
lucky_strings('ab') #=> 2 | |
lucky_strings('aaab') #=> 0 |
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
import java.util.Collections; | |
import java.util.Stack; | |
public class QueueWith2Stacks { | |
private Stack<Integer> stack1 =null; | |
private Stack<Integer> stack2 =null; | |
private ArrayList<Integer> minList =null; | |