Skip to content

Instantly share code, notes, and snippets.

View casweeney's full-sized avatar
👨‍💻
Building Platforms

Coding Cas casweeney

👨‍💻
Building Platforms
View GitHub Profile
import {
time,
loadFixture,
} from "@nomicfoundation/hardhat-toolbox/network-helpers";
import { anyValue } from "@nomicfoundation/hardhat-chai-matchers/withArgs";
import { expect } from "chai";
import { ethers } from "hardhat";
describe("Lock", function () {
// We define a fixture to reuse the same setup in every test.
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.24;
contract MultiSig {
address owner;
address[] signers;
uint256 quorum;
uint256 txCount;
address nextOwner;
use std::collections::HashSet;
use rand::Rng;
fn power_set(set: &Vec<i32>) -> Vec<Vec<i32>> {
let mut result = Vec::new();
let size = set.len();
let no_of_subsets = 1 << size;
for i in 0..no_of_subsets {
let mut subset = Vec::new();
// Iteration
function fibonacci(n) {
const fib = [0, 1];
for (let i = 2; i <= n; i++) {
fib[i] = fib[i - 1] + fib[i - 2];
}
// const fibb = {
// fibonacci: fib,
fn main() {
println!("{}", fibonacci(7));
}
// Using Recursion
// fn fibonacci(n: usize) -> usize {
// if (n < 2) {
// return n;
// }
fn main() {
println!("{}", factorial(4));
}
// Using Recursion
// fn factorial(n: usize) -> usize {
// if( n == 0) {
// return 1;
// } else {
// return factorial(n-1) * n;