deno.land / x / masx200_leetcode_test@10.6.5 / first-letter-to-appear-twice / index.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function repeatedCharacter(s: string): string { let bitset = 0n; for (const char of s) { const num = BigInt( 1n << BigInt(char.charCodeAt(0) - "a".charCodeAt(0) + 1), ); if (bitset & num) { return char; } bitset |= num; // console.log(bitset,num) } return s[0];}export default repeatedCharacter;
masx200_leetcode_test

Version Info

Tagged at
a year ago