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
const { Contract, ContractFactory, utils, BigNumber } = require("ethers") | |
const WETH9 = require("../WETH9.json") | |
const artifacts = { | |
UniswapV3Factory: require("@uniswap/v3-core/artifacts/contracts/UniswapV3Factory.sol/UniswapV3Factory.json"), | |
SwapRouter: require("@uniswap/v3-periphery/artifacts/contracts/SwapRouter.sol/SwapRouter.json"), | |
NFTDescriptor: require("@uniswap/v3-periphery/artifacts/contracts/libraries/NFTDescriptor.sol/NFTDescriptor.json"), | |
NonfungibleTokenPositionDescriptor: require("@uniswap/v3-periphery/artifacts/contracts/NonfungibleTokenPositionDescriptor.sol/NonfungibleTokenPositionDescriptor.json"), | |
NonfungiblePositionManager: require("@uniswap/v3-periphery/artifacts/contracts/NonfungiblePositionManager.sol/NonfungiblePositionManager.json"), | |
WETH9, |
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
let i=0,j=0,res=[]; | |
const traverse = (arr) => { | |
while(!visited(arr)){ | |
goRight(arr); | |
goDown(arr); | |
goLeft(arr); | |
goUp(arr); | |
} | |
return res; |
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
//stackoverflow | |
function flatten(arr) { | |
let i = 0; | |
if (!Array.isArray(arr)) { | |
/* return non-array inputs immediately to avoid errors */ | |
return arr; | |
} | |
while (i < arr.length) { |
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
codewars |
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
class ZombiesController < ApplicationController | |
def index | |
if params[:name] | |
@zombie=Zombie.where(:name => params[:name]).first | |
@[email protected] | |
else | |
@z=Zombie.all | |
end | |
end |