Crates.io | leetcode_prelude |
lib.rs | leetcode_prelude |
version | 0.2.3 |
source | src |
created_at | 2018-12-29 10:50:12.874321 |
updated_at | 2020-08-14 12:56:24.883619 |
description | Some useful macros and definition for exercising in leetcode |
homepage | https://github.com/Aloxaf/leetcode_prelude |
repository | https://github.com/Aloxaf/leetcode_prelude |
max_upload_size | |
id | 104382 |
size | 6,880 |
Some useful macros and definition for exercising in LeetCode.
Add following lines to your Cargo.toml.
[dependencies]
leetcode_prelude = "^0.2"
use leetcode_prelude::btree;
let btree = btree![1, 2, 2, null, null, 3, 3];
use leetcode_prelude::linkedlist;
let linkedlist = linkedlist![1, 2, 3];
use leetcode_prelude::leetcode_test;
leetcode_test!(
["Trie", "insert", "search"]
[[], ["apple"], ["apple"]]
[null, null, true]
)
Vec<String>
use leetcode_prelude::vec_string;
let vec = vec_string!["1", "2", "3"];
use leetcode_prelude::assert_eq_sorted;
assert_eq_sorted!(vec![1, 2], vec![2, 1]);