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
wit_bindgen_rust::export!("../guesttwo.wit"); | |
struct Guesttwo {} | |
impl guesttwo::Guesttwo for Guesttwo { | |
fn hellotwo(name: String) -> String { | |
let res = format!("Helloooooooo {}!", name); | |
res | |
} | |
} |
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
// 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)); |
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
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 {}; | |
} |