Skip to content

Instantly share code, notes, and snippets.

View ivandashk's full-sized avatar

Ivan Dashkevich ivandashk

View GitHub Profile
@ivandashk
ivandashk / 13b.js
Created December 13, 2022 12:31
Advent of Code 22 — 13b
const fs = require('fs');
const readline = require('readline');
function compare(left, right) {
for (let i = 0; i < Math.max(left.length, right.length); i++) {
let leftValue = left.at(i);
let rightValue = right.at(i);
if (leftValue === undefined) return -1;
if (rightValue === undefined) return 1;
#include <bits/stdc++.h>
#include <cstdlib>
#include<iostream>
using namespace std;
main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int T;cin>>T;
'use strict';
function solve() {
}
function main() {
const numOfCases = rlsn();
for (let testCase = 0; testCase < numOfCases; testCase++) {
function solve() {
var input = rlsn();
return input;
}
// ===========
var T = rlsn();
while (T--) {
var result = solve();
cl(result);
@ivandashk
ivandashk / component-base.js
Last active August 3, 2018 08:24
component-way
document.componentRegistry = { };
document.nextId = 0;
export default class Component {
constructor() {
this._id = ++document.nextId;
document.componentRegistry[this._id] = this;
}
mount (container) {