Skip to content

Instantly share code, notes, and snippets.

@leetcode-notes
leetcode-notes / gist:d8d0f08d58eda567edf2b1ef99dd73d3
Created July 20, 2020 00:29 — forked from alexkay/gist:1600725
Code Sprint 2 - Subsequence Weighting
#include <algorithm>
#include <iostream>
#include <set>
using namespace std;
struct Node {
int a;
long long w;
Node *prev;
// This is an example of how to fetch external data in response to updated props,
// If you are using an async mechanism that does not support cancellation (e.g. a Promise).
class ExampleComponent extends React.Component {
_currentId = null;
state = {
externalData: null
};
@leetcode-notes
leetcode-notes / A-umbrella.md
Created August 28, 2020 21:00 — forked from lubien/A-umbrella.md
Umbrella Challenge

Umbrella Challenge

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.

Examples