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
// https://www.hackerrank.com/challenges/missing-numbers/problem | |
// this solution posted as comment on, to explain how O(n) solution is designed: | |
// = https://www.youtube.com/watch?v=N6r9Dh68Y3o | |
vector<int> missingNumbers(vector<int> arr, vector<int> brr) { | |
auto const base = brr.front(); | |
int freqs[100] {0}; | |
int actual_base = base; | |
for(auto const item : brr) { |
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
'use strict'; | |
const express = require('express'); | |
// Constants | |
const PORT = 8080; | |
const HOST = '0.0.0.0'; | |
// App | |
const app = express(); |
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
// Start the application | |
tokio::run(lazy(|| { | |
let addr = "127.0.0.1:0".parse().unwrap(); | |
let listener = TcpListener::bind(&addr).unwrap(); | |
// Create the channel that is used to communicate with the | |
// background task. | |
let (tx, rx) = mpsc::channel(1_024); | |
// Spawn the background task: |