Skip to content

Instantly share code, notes, and snippets.

View HackPoint's full-sized avatar

HackP0!nt HackPoint

  • Israel
View GitHub Profile
/**
* Definition for a binary tree node.
* class TreeNode {
* val: number
* left: TreeNode | null
* right: TreeNode | null
* constructor(val?: number, left?: TreeNode | null, right?: TreeNode | null) {
* this.val = (val===undefined ? 0 : val)
* this.left = (left===undefined ? null : left)
* this.right = (right===undefined ? null : right)
function permute(word, pattern, permutations = []) {
if(word.length === 0) {
permutations.push(pattern);
}
for(let i = 0; i < word.length; i++) {
let char = word[i];
let left = word.slice(0, i);
let right = word.slice(i + 1);
@HackPoint
HackPoint / router.tsx
Created June 28, 2023 08:23
say why?
import {
BrowserRouter,
Navigate,
useNavigate,
useRoutes,
} from "react-router-dom";
import { ErrorBoundary } from "src/components/ErrorBoundary";
import { PageLayout } from "src/components/pageLayout/pageLayout";
import {
BooksContextProvider,