Advertisement
alvinfnaldi

String Construction

Sep 24th, 2023
846
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {
  2.   const stringConstruction = (s: string) => {
  3.     let val = new Set(s);
  4.     let array = [...val];
  5.     let lengthStr = array.length;
  6.     return lengthStr;
  7.   };
  8.  
  9.   let result = stringConstruction("1234");
  10.   console.log(result);
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement