function differentSymbolsNaive(str) {
// write code here.
//includes split push
let newString = str.split("");
let newArray = [];
for (let i = 0; i < newString.length; i++) {
if (newString.includes(newString[i])
&& !newArray.includes(newString[i])) {
newArray.push(newString[i])
}
}
return newArray.length;
}
/**
* Test Suite
*/
describe('differentSymbolsNaive()', () => {
it('returns count of unique characters', () => {
// arrange
const str = 'cabca';
//const str = 'cabca123';
//const str = 'cabca123#'
// act
const result = differentSymbolsNaive(str);
// log
console.log("result: ", result);
// assert
expect(result).toBe(3);
//expect(result).toBe(6);
//expect(result).toBe(7);
});
});