MCPcopy Create free account
hub / github.com/neetcode-gh/leetcode / getTabu

Function getTabu

javascript/0091-decode-ways.js:58–65  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

56};
57
58const getTabu = (s) => {
59 const tabu = new Array(s.length + 1).fill(0);
60
61 tabu[0] = 1;
62 tabu[1] = s[1] === '0' ? 0 : 1;
63
64 return tabu;
65};
66
67var decode = (s, tabu) => {
68 for (let curr = 2; curr < tabu.length; curr++) {

Callers 1

numDecodingsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected