Saved for posterity. You're welcome :)
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 | |
# Install | |
brew install llvm | |
brew install libomp | |
# Compile | |
# clang++ test.cpp -o test -Xpreprocessor -fopenmp -lomp |
Given a number of people N and an array of integers, each one representing the amount of people a type of umbrella can handle, output the minimum number of umbrellas needed to handle N people.
No umbrella could have left spaces. Which means if a umbrella can handle 2 people, there should be 2 people under it.
If there's no solution, return -1
.
- Clarify and agree on the scope of the system
- User cases (description of sequences of events that, taken together, lead to a system doing something useful)
- Who is going to use it?
- How are they going to use it?
- Constraints
- Mainly identify traffic and data handling constraints at scale.
- Scale of the system such as requests per second, requests types, data written per second, data read per second)
The key components of the system are:
- Frontend: The web and mobile applications that users interact with to select and navigate routes.
- Backend API: The API that provides the predefined routes to the frontend and stores completed routes for users.
- User service: The service that handles user operations. Such as following and viewing other users and modifying user profiles
- Route service: The service that handles route operations. Such as creating, updating, and deleting routes.
- Real-time location tracking service: The service that tracks the position of other users navigating the same route in real-time.
var foo = function foo() {
console.log(foo === foo);
};
foo();
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
// Solves this problem: http://1mage.us/1339. | |
package main | |
import ( | |
"fmt" | |
"math" | |
"math/rand" | |
"sort" |
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 z3 | |
def add_constraints(s, inp): | |
for digit in inp: | |
s.add(digit > 0) | |
s.add(digit < 200) | |
b = [(6,10,11),(9,12,13),(15,16,17),(6,9,15),(10,12,16),(11,13,17), (6,12,17),(11,12,15)] | |
a = [(1,2,3),(4,5,6),(7,8,9),(1,4,7),(2,5,8),(3,6,9), (1,5,9),(3,5,6)] | |
c = [(18,7,8),(19,20,14),(21,22,23),(18,19,21),(7,20,22),(8,14,23), (18,20,23),(21,20,8)] |
NewerOlder