Badges
khaledashrakat10 has not unlocked any badges yet.
Certifications
khaledashrakat10 has not earned any certificates yet.
Work Experience
Software Engineer
HSBC• January 2022 - January 2023
/*active-traders def mostActive(customers): d = defaultdict(int) for c in customers: d[c] += 1 return sorted([c for c, cnt in d.item() if cnt / len(customers) >= 0.05]) */ /* balanced-system-files-partition def mostBalancedPartition(parentfiles_size): n = len(parent) children = [[] for _ in range(n)] for i in range(1, n): children[parent[i]].append(i) size_sums = [None for _ in range(n)] def size_sums_rec(i): size_sums[i] = files_size[i] + sum(size_sums_rec(c) for c in children[i]) return size_sums[i] size_sums_rec(0) return min(abs(size_sums[0] - 2 * ss) for ss in size_sums[1:]) */ /* longest-subarray def longestSubarray(arr): n = len(arr) ans = 0 for i in range(n): w = [] cnt = 0 for j in range(i, n): if arr[j] in w: cnt += 1 continue if len(w) == 0: w.append(arr[j]) elif len(w) == 1: if abs(w[0] - arr[j]) > 1: break else: w.append(arr[j]) else: break cnt += 1 ans = max(ans, cnt) return ans */ /* maximum-cost-of-laptop-count def maxCost(cost, labels, dailyCount): ans = 0 cur_cnt = 0 cur_cost = 0 for c, l in zip(cost, labels): cur_cost += c if l == "illegal": continue cur_cnt += 1 if cur_cnt == dailyCount: ans = max(ans, cur_cost) cur_cnt = 0 cur_cost = 0 return ans */ /* nearly-similar-rectangles def nearlySimilarRectangles(sides): gcd = lambda a, b:gcd(b, a % b) if b > 0 else a d = defaultdict(int) for w, h in sides: z = gcd(w, h) d[(w // z, h // z)] += 1 return sum((x * (x - 1)) // 2 for x in d.values()) */ /* parallel-processing def minTime(files, numCores, limit): x = [] y = [] for f in files: if f % numCores == 0: x.append(f) else: y.append(f) x.sort(reverse=True) return (sum(x[:limit]) // numCores) + sum(x[limit:]) + sum(y) */ /* password-decryption def decryptPassword(s): s = list(s) i = 0 while i < len(s) and s[i].isdigit() and s[i] != "0": i += 1 for j, k in enumerate([l for l in range(i, len(s)) if s[l] == "0"]): s[k] = s[i - j - 1] for j in range(i, len(s)): if s[j] == "*": s[j - 1], s[j - 2] = s[j - 2], s[j - 1] return "".join(s[i:]).replace("*", "") */ /* road-repair def getMinCost(crew_id, job_id): crew_id.sort() job_id.sort() return sum(abs(c - j) for c, j in zip(crew_id, job_id)) */ /*string-anagram def stringAnagram(dictionary, query): d = defaultdict(int) for w in dictionary: d["".join(sorted(w))] += 1 ans = [] for w in query: w = "".join(sorted(w)) ans.append(d[w] if w in d else 0) return ans */ /* subarray-sums def findSum(numbers, queries): a = [0] b = [0] for x in numbers: a.append(a[-1] + x) b.append(b[-1] + (x == 0)) return [a[r] - a[l - 1] + x * (b[r] - b[l - 1])for l, r, x in queries] */ /*unexpected-demand def filledOrders(order, k): order.sort() ans = 0 for x in order: if x <= k: ans += 1 k -= x else: break return ans */ /* usernames-changes def possibleChanges(usernames): ans = [] for u in usernames: if len(u) <= 1: ans.append("NO") for i in range(len(u) - 1): if u[i] > u[i + 1]: ans.append("YES") break else: ans.append("NO") return ans */ /*vowel-substring def findSubstring(s, k): vowels = ["a", "e", "i", "o", "u"] cur = best = sum([c in vowels for c in s[:k]) ans = 0 for i in range(k, len(s)): cur += s[i] in vowels cur -= s[i - k] in vowels if cur > best: best = cur ans = i - k + 1 if best > 0: return s[ans:(ans+k)] else: return "Not found!" */
Education
khaledashrakat10 has not updated education details yet.
Links
khaledashrakat10 has not updated links details yet.
Skills
khaledashrakat10 has not updated skills details yet.