2026 June 13 Problems

25 views
Skip to first unread message

daryl...@gmail.com

unread,
Jun 13, 2026, 12:43:36 PM (6 days ago) Jun 13
to leetcode-meetup
Feel free to work on any of the problems you want; we'll have people present their solutions at 11:30.

Please post your solutions to this thread so others can use this as a reference.





Here is the meeting url:

Full details:

Topic: Leet Code meeting
Time: Mar 28, 2026 10:00 AM Pacific Time (US and Canada)
        Every week on Sat, 110 occurrence(s)
Please download and import the following iCalendar (.ics) files to your calendar system.
Weekly: https://us05web.zoom.us/meeting/tZYocuqgqzMuH9IuHUphHIiZ_4T4IndJLToX/ics?icsToken=DJFc88pL6-me_TneLwAALAAAAA70ShjYgLH6RfEnqUm5LK03v2OgtbXujwlKXRMVgIVWCY9aONPJMCycMlkhyPZ3XSrMVVgXDSYlGF_r7DAwMDAwMQ&meetingMasterEventId=MGJmt5lJTd6mPygcS0hiAQ
Join Zoom Meeting
https://us05web.zoom.us/j/82553858456?pwd=fnK5Vb0CcfFpv0lnouILjeEs2z2Khc.1

Meeting ID: 825 5385 8456
Passcode: 182596


Carlos Green

unread,
Jun 13, 2026, 1:06:59 PM (6 days ago) Jun 13
to leetcode-meetup
/**
* @param {string[]} arr
* @param {number} k
* @return {string}
*/
var kthDistinct = function(arr, k) {
const freq = arr.reduce((a,c) => {
a[c] = (a[c] || 0) + 1
return a
}, {})

for (let i = 0; i < arr.length; i++) {
if (freq[arr[i]] === 1 && k > 0) {
k--
}

if (k === 0) {
return arr[i]
}
}
return ""
};

Allen S.

unread,
Jun 14, 2026, 10:21:16 PM (4 days ago) Jun 14
to leetcode-meetup
func kthDistinct(arr []string, k int) string {
isDistinct := make(map[string]bool)
for _, v := range arr {
if _, ok := isDistinct[v]; ok {
isDistinct[v] = false
} else {
isDistinct[v] = true
}
}
for _, v := range arr {
if isDistinct[v] {
k--
}
if k == 0 {
return v
}
}
return ""
}
Reply all
Reply to author
Forward
0 new messages