Skip to content

Instantly share code, notes, and snippets.

View statox's full-sized avatar

Adrien Fabre statox

View GitHub Profile
@statox
statox / Victor.ts
Created January 25, 2021 10:52
A typescript vector classe that I use in codingame challenges
const degrees = 180 / Math.PI;
function radian2degrees (rad: number): number {
return rad * degrees;
}
function degrees2radian (deg: number): number {
return deg / degrees;
}
@statox
statox / leetcode-add-two-numbers.js
Created June 21, 2021 14:00
Leetcode: Add two numbers
// https://leetcode.com/submissions/detail/508355858/
/**
* Definition for singly-linked list.
* function ListNode(val, next) {
* this.val = (val===undefined ? 0 : val)
* this.next = (next===undefined ? null : next)
* }
*/
/**
* @param {ListNode} l1
const S = [1, 2, 3];
const n = 4;
const f = (S, n) => {
const stack = S.map((coin) => [coin]);
const permuts = new Set();
while (stack.length) {
const current = stack.shift();
const sum = current.reduce((s, c) => s + c);
const S = [1, 2, 3];
const n = 4;
const f = (S, n) => {
const stack = S.map((coin) => [coin]);
const permuts = new Set();
while (stack.length) {
const current = stack.shift();
const sum = current.reduce((s, c) => s + c);