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 subprocess | |
# var = subprocess.call("date") | |
# subprocess.call(["ls", "-l", "/etc/hosts"]) | |
# p = subprocess.Popen("date", stdout=subprocess.PIPE, shell=True) | |
# (output, err) = p.communicate() | |
# print("Today is", output) | |
# p = subprocess.Popen(["ls", "-l", "/etc/hosts"], stdout=subprocess.PIPE) | |
# output, err = p.communicate() |
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
@cache = [] | |
def cache_recursion_solution(n, k) | |
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
# wined coins | |
n1 = 10 | |
n2 = 18 | |
# used all-in | |
k1 = 10 | |
k2 = 2 | |
def solution(n, k) | |
steps = 0 | |
while n > 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
text = {:user=>{:first_name=>["must be filled"], :email_address=>["Wrong email format"], :phone_number=>["Wrong phone number format. Use only digits with + on begining"], :address_attributes=>{:street=>["must be filled"], :city=>["must be filled"], :zip_code=>["Wrong zip code format. Use 00-000 format insted"], :country=>["Is not a correct country name"]}, :company_attributes=>{:address_attributes=>{:zip_code=>["Wrong zip code format. Use 00-000 format insted"], :country=>["Is not a correct country name"]}}}} | |
# def parse v | |
# if v.is_a?(Hash) | |
# v.each do |k, v| | |
# parse v | |
# p "#{k v}" | |
# 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
text = {:user=>{:first_name=>["must be filled"], :email_address=>["Wrong email format"], :phone_number=>["Wrong phone number format. Use only digits with + on begining"], :address_attributes=>{:street=>["must be filled"], :city=>["must be filled"], :zip_code=>["Wrong zip code format. Use 00-000 format insted"], :country=>["Is not a correct country name"]}, :company_attributes=>{:address_attributes=>{:zip_code=>["Wrong zip code format. Use 00-000 format insted"], :country=>["Is not a correct country name"]}}}} | |
# def parse v | |
# if v.is_a?(Hash) | |
# v.each do |k, v| | |
# parse v | |
# p "#{k v}" | |
# end |