AlgoDaily Solution
1Locked, only available for premium members.
Community Solutions
Community solutions are only available for premium users.
Access all course materials today
The rest of this tutorial's contents are only available for premium members. Please explore your options at the link below.
xxxxxxxxxx
36
var assert = require('assert');
function stringBreakdown(str, dictArr) {
return true;
}
const str = 'applecomputer';
const dictArr = ['apple', 'computer'];
stringBreakdown(str, dictArr);
// true
try {
assert.equal(
stringBreakdown('crazyrichasians', ['crazy', 'rich', 'asians']),
true
);
console.log(
'PASSED: ' +
"Expect <code>stringBreakdown('crazyrichasians', ['crazy', 'rich', 'asians'])</code> to return <code>true</code>"
);
} catch (err) {
console.log(err);
}
try {
assert.equal(stringBreakdown('lockcombination', ['lock', 'combo']), false);
OUTPUT
Results will appear here.