Skip to content

Instantly share code, notes, and snippets.

View heyqbnk's full-sized avatar

Vladislav Kibenko heyqbnk

View GitHub Profile
@heyqbnk
heyqbnk / index.ts
Created May 13, 2023 08:18
Leetcode problem solution: 2466. Count Ways To Build Good Strings
// Problem: https://leetcode.com/problems/count-ways-to-build-good-strings/description/
const MOD = 1e9 + 7;
function countGoodStrings(low: number, high: number, zero: number, one: number): number {
return count(0, low, high, zero, one, new Array(high+1));
};
function count(len: number, low: number, high: number, zero: number, one: number, cache: number[]): number {
// In case, current length is higher than highest allowed length,
@heyqbnk
heyqbnk / index.ts
Created March 27, 2022 11:58
Create TON wallet from mnemonic (24 words).
import TonWeb, {HttpProvider} from 'tonweb';
import {mnemonicToSeed} from 'tonweb-mnemonic';
(async () => {
// First of all, create seed from mnemonic. Mnemonic is a
// combination of 24 words. For example, you could already
// create your wallet in TON Keeper application, where these 24
// words were used. You can use them here too, to get access
// to your wallet.
const seed = await mnemonicToSeed([/* Array of 24 words goes here. */]);
@heyqbnk
heyqbnk / README.md
Last active March 23, 2022 01:00
TypeLanguage ANTLR v4 grammar
const Benchmark = require('benchmark')
const {BigInt: JSBI, add, subtract, divide, multiply} = require('jsbi');
const suite = new Benchmark.Suite
// native numbers
let num_a, num_b
// BigInt numbers
let bi_a, bi_b
// JSBI numbers