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
| javascript:(function(){ var baseURL = window.location.origin; var newURL = baseURL + '/api/developer/token'; window.location.href = newURL;})(); |
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
| matrix = [] | |
| $totaltrees = [] | |
| x, y, $trees, slope = 0, 0, 0, -1 | |
| File.foreach('3.txt') { |line| matrix << line.strip.split('') and slope += 1 } | |
| possibilities = [[1,1], | |
| [3,1], | |
| [5,1], | |
| [7,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
| array = [] | |
| valid = 0 | |
| def min(len) | |
| len.split('-')[0].to_i - 1 | |
| end | |
| def max(len) | |
| len.split('-')[1].to_i - 1 | |
| 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
| array = [] | |
| valid = 0 | |
| def min(len) | |
| len.split("-")[0].to_i | |
| end | |
| def max(len) | |
| len.split("-")[1].to_i | |
| 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
| array = [] | |
| File.foreach("input1.txt") { |line| array << line.to_i } | |
| pairs = array.combination(ARGV[0].to_i) | |
| pairs.each do |pair| | |
| if pair.sum == 2020 | |
| puts pair[0..-1].reduce(:*) | |
| 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
| import java.text.SimpleDateFormat; | |
| import java.text.DateFormat; | |
| import java.util.Calendar; | |
| import java.util.Date; | |
| public class TalkingClock { | |
| public static void main(String[] args) { |