Skip to content

Instantly share code, notes, and snippets.

View f3lixding's full-sized avatar

Felix Ding f3lixding

View GitHub Profile
@f3lixding
f3lixding / guest::lib.rs
Last active August 17, 2022 06:19
embed_wasm_in_c
wit_bindgen_rust::export!("../guesttwo.wit");
struct Guesttwo {}
impl guesttwo::Guesttwo for Guesttwo {
fn hellotwo(name: String) -> String {
let res = format!("Helloooooooo {}!", name);
res
}
}
// assuming the node has the following structure:
class Node {
constructor(value) {
this.val = value;
this.children = [];
}
addNode(val) {
if (typeof val === 'number') {
this.children.push(new Node(val));
class Solution {
public:
vector<vector<int>> generate(int numRows) {
vector<vector<int>> res;
vector<int> lastRow;
lastRow.push_back(1);
res.push_back(lastRow);
if (!numRows) {
return {};
}