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
| #!/bin/bash | |
| set -euf -o pipefail | |
| if [ ! -f code-server ]; then | |
| ARCH=$(uname -m) | |
| OS="unknown-linux-gnu" | |
| echo "downloading code-server ($ARCH-$OS)" | |
| URL="https://vscodeserverlauncher.blob.core.windows.net/builds/latestbin/$ARCH-$OS/$ARCH-$OS" | |
| curl -L "$URL" >code-server | |
| chmod +x code-server |
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
| const MAX_INFLIGHT = 4; | |
| const TOTAL = 100; | |
| // the given dummy api supports a maximum of 4 of inflight requests. | |
| // the given code is correct, but it is slow because it processes elements serially. | |
| // your task is to process 100 elements as fast as possible. | |
| // run this code with "node/bun test.js". | |
| // it should print "pass". | |
| // no external dependencies are allowed. | |
| async function run(elements) { | |
| // ============ |
OlderNewer