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
import browser from 'webextension-polyfill' | |
import { useState, useEffect } from 'react' | |
function isDiferent (a, b) { | |
if (typeof a !== typeof b) { | |
return true | |
} | |
if (Array.isArray(a)) { | |
return arrayIsDifferent(a, b) | |
} |
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
/** | |
* flatten an array of arbitrarily nested arrays of integers into a flat array of integers. e.g. [[1,2,[3]],4] -> [1,2,3,4]. | |
* @param {[number]} from array to be flatternd | |
* @param {[number]} [to] array where integers are placed. Defaults to [], and it is used only for recursion. | |
* @return {[number]} flattern array | |
*/ | |
function flatten (from, to = []) { | |
from.forEach(value => { | |
if (Array.isArray(value)) { |
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
def nextSet (s): | |
""" | |
Esta función obtiene el siguiente subconjunto al subconjunto dado | |
""" | |
decrement = len(s) - 1 | |
if decrement == -1: | |
return [0] | |
increment = decrement | |
while True: | |
increment -=1 |