Threadser.net
數據
關鍵字
功能建議
Following
Threads
Login
串文
串文鏈結
2024-11-03 09:55
You need to check if all characters in a given string are unique. Assume the string contains only ASCII characters. How'd you do it?
讚
7
回覆
143
轉發
1
作者
Ramon Sorage
rsorage
粉絲
串文
91+
讚
回覆
轉發
24小時粉絲增長
發文前
35
發文後24小時
35
變化
0 (0.00%)
互動率
(讚 + 回覆 + 轉發) / 粉絲數
Infinity%
回覆 (BETA)
最先回覆的內容
發文後
用戶
內容
一小時內
David Vanni
dax85x
Distinct and counting if equals the string length bool allCharsUnique = (text.Distinct().ToArray().Length == text.Length);
2 小時內
Waffl
wafflchat
The answer to all leet code challenges is “hashmap”
3 小時內
M@rk B
tremendous_dynamiterr24
Cut and paste into a spreadsheet. Count characters. Count unique characters
5 小時內
蔡孟修
mathtsai
bool exist[256] = {false}; Scan through s.
9 小時內
Steve
herspacemonkeymafia
long mask[4] = [0,0,0,0]; Int offset = 0; If (len(str) > 128) return false; For (i=0,i<len(str);i++){ offset=str[i]>>5; if(mask[offset]&&(1<<(str[i]&&31))>0)return false; else mask[offset]|=1<<(str[i]&&31); } return true;