This file contains 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
// @ts-check | |
const fs = require('fs'); | |
const path = require('path'); | |
// CATATAN: | |
// Untuk Path, apabila di CMD tertera sebagai C:\Users\darkash\Desktop | |
// maka setiap backslash "\" wajib diulang 2x menjadi C:\\Users\\darkash\\Desktop | |
const inputPath = path.format({ | |
dir: 'C:\\Users\\darkash\\Desktop', // lokasi folder file input, disesuaikan |
This file contains 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
/* | |
enable on URLs starting with: https://silveredtongue.wordpress.com | |
*/ | |
.post-template-default, .page-template-default, .home { | |
filter: invert(1) hue-rotate(180deg); | |
} | |
.custom-header { | |
filter: invert(1) hue-rotate(180deg); |
This file contains 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
required = %w[byr iyr eyr hgt hcl ecl pid] | |
optional = %w[cid] | |
input = "ecl:gry pid:860033327 eyr:2020 hcl:#fffffd | |
byr:1937 iyr:2017 cid:147 hgt:183cm | |
iyr:2013 ecl:amb cid:350 eyr:2023 pid:028048884 | |
hcl:#cfa07d byr:1929 | |
hcl:#ae17e1 iyr:2013 |
This file contains 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
input = %w[..##....... | |
#...#...#.. | |
.#....#..#. | |
..#.#...#.# | |
.#...##..#. | |
..#.##..... | |
.#.#.#....# | |
.#........# | |
#.##...#... | |
#...##....# |
This file contains 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
input = [ | |
"1-3 a: abcde", | |
"1-3 b: cdefg", | |
"2-9 c: ccccccccc" | |
] | |
def parse(str) | |
str.match(/(?<min>\d+)-(?<max>\d+) (?<char>\S): (?<testcase>\S+)/) | |
end |
This file contains 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
input = %w[1721 | |
979 | |
366 | |
299 | |
675 | |
1456].map(&:to_i) | |
first_num = input.find { |x| input.include?(2020 - x) } | |
second_num = 2020 - first_num | |
first_num * second_num |