Skip to content

Instantly share code, notes, and snippets.

View idontcares31249's full-sized avatar
😠

Idontcares idontcares31249

😠
View GitHub Profile
@idontcares31249
idontcares31249 / word-search-ii.js
Created June 21, 2022 19:03
my solution for Word Search II problem (https://leetcode.com/problems/word-search-ii/). Probably has gigantic time complexity, so I'm 90% sure you can optimize the heck of it.
function* anf(length, base) {
let arr = new Array(length).fill(0);
while (true) {
yield arr;
let br = true;
for (let i = 0; i < length; i++) {
if (arr[i] != base - 1) {
++arr[i];