Skip to content

Instantly share code, notes, and snippets.

View 0xhmn's full-sized avatar

Hooman Yar 0xhmn

View GitHub Profile

Headline

Checklist

1. Understand the problem and establish design scope

  1. User/Customer
  • who will use this system
  • how this system will be used
import hre, { ethers } from "hardhat";
import { Contract } from "ethers";
describe("Forking", function () {
it("Should fork mainnet4", async function () {
const mainnetTestAccountAddress = "0x618d17fa59c67aEA20A88dc75d4E28E728a6fF28";
const usdcAbi = require("@openzeppelin/contracts/build/contracts/IERC20.json").abi;
const usdcAddress = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";
// check the block number
public class MinPathWithOneFlip {
/**
* [x,y,flip,dist] -> we can get to i=2,j=0 in two different ways: [2,0,1,1] && [2,0,0,8]
* we should keep track of two different scenarios. if we have flipped and reached there or if we reached there with no flip
*/
int[][] DIR = {{1,0}, {0,1}, {-1,0}, {0,-1}};
int minPath(int[][] board) {
int m = board.length;
public String sort(String s, int k) {
Map<Character, Integer> map = new HashMap<>();
for(char c : s.toCharArray()) {
map.put(c, map.getOrDefault(c, 0) + 1);
}
// largest char first
PriorityQueue<Map.Entry<Character, Integer>> pq = new PriorityQueue<>((a,b) -> {
return (b.getKey() - a.getKey());
@0xhmn
0xhmn / anki_flag
Last active August 7, 2020 05:39
updating the anki_flag from patch call
843
43
863
121
173
124
272
39
536
426