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
| ============= | |
| == FOR K=8 == | |
| ============= | |
| Cardinalities [ | |
| [ 'E', 85998 ], [ 'S', 66786 ], | |
| [ 'I', 65837 ], [ 'A', 59318 ], | |
| [ 'R', 54496 ], [ 'N', 53586 ], | |
| [ 'T', 49932 ], [ 'O', 46240 ], | |
| [ 'L', 39990 ], [ 'C', 30033 ], | |
| [ 'D', 28418 ], [ 'U', 25051 ], |
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
| async function run(elements) { | |
| // ============ | |
| // your code here starts here | |
| const results = []; | |
| const pending = new Set(); | |
| const order = elements.map((element,i)=>({element,i})); | |
| while(order.length) { | |
| const {element,i} = order.shift(); | |
| const promise = api(element); | |
| pending.add(promise); |
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 _(tagname, attributes) { | |
| var result = null; | |
| if(attributes && attributes.xmlns) { | |
| result = document.createElementNS(attributes.xmlns, tagname); | |
| } else { | |
| result = document.createElement(tagname || "div"); | |
| } | |
| if(attributes) { | |
| Object.keys(attributes).forEach(function(name) { | |
| if("xmlns" == name) return; |
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
| {-# LANGUAGE OverloadedStrings #-} | |
| module Main where | |
| import System.IO | |
| import Control.Applicative | |
| import Database.SQLite.Simple | |
| import Database.SQLite.Simple.FromRow | |
| import Control.Monad |
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
| next n | |
| | rem n 2 == 0 = div n 2 | |
| | otherwise = 3*n+1 | |
| collatz 1 = [1] | |
| collatz n = n : (collatz (next n)) | |
| collatzLength n = | |
| (n, length (collatz n)) |
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
| import Data.List (sort) | |
| import qualified Data.Map.Strict as M | |
| main = interact (\s -> parts (analysed (nel s))) | |
| where parts lst = part1 lst ++ "\n" ++ part2 lst ++ "\n" | |
| nel s = filter (not . null) (lines s) | |
| analysed lines = zip lines (map inspect lines) | |
| data Status = | |
| Corrupted Char Char |