This file contains hidden or 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
pragma solidity ^0.5.0; | |
interface Oracle { | |
enum QueryStatus { INVALID, OK, NOT_AVAILABLE, DISAGREEMENT } | |
function query(bytes calldata input) | |
external payable returns (bytes32 output, uint256 updatedAt, QueryStatus status); | |
function queryPrice() external view returns (uint256); | |
} | |
contract CoinGeckoVolumeContract { |
This file contains hidden or 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
{ | |
"meta": { | |
"version": "1", | |
"info": { | |
"image": "https://www.coingecko.com/thumbnail.png", | |
"description": "CoinGecko: 24hr Trading Volume" | |
}, | |
"aggregation": "MEDIAN", | |
"variables": [ | |
"string" |
This file contains hidden or 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
function check(letterPool, word) { | |
// S1 | |
const map = {} | |
for (let i=0; i<letterPool.length; i++) { | |
const character = letterPool[i] | |
if (map[character] === undefined) { | |
map[character] = 1 | |
} else { | |
map[character] += 1 | |
} |
This file contains hidden or 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
function anagram(lp, word) { | |
const m = lp.reduce((o, w) => Object.assign(o, {[w]: (o[w] || 0)+1}), {}) | |
return !word.split('').some(c => !m[c]--) | |
} |
NewerOlder