Design A Leaderboard Leetcode Solution

Problem Statement The Design A Leaderboard LeetCode Solution – “Design A Leaderboard” asks you to complete 3 functions: addScore(playerId, score): Update the leaderboard by adding a score to the given player’s score. If there doesn’t exist any player, add such id on the leaderboard. top(K): Return the top sum of …

Read more

Employee Free Time LeetCode Solution

Problem Statement Employee Free Time LeetCode Solution – We are given a list schedule of employees, which represents the working time for each employee. Each employee has a list of non-overlapping Intervals, and these intervals are in sorted order. Return the list of finite intervals representing the common, positive-length free time for all employees, also in …

Read more

Longest Palindromic Substring LeetCode Solution

Problem Statement The Longest Palindromic Substring LeetCode Solution – “Longest Palindromic Substring” states that You are Given a string s, return the longest palindromic substring in s. Note: A palindrome is a word that reads the same backward as forwards, e.g. madam. Example:   s = “babad” “bab” Explanation: All …

Read more

Median of Two Sorted Arrays LeetCode Solution

Problem statement Median of Two Sorted Arrays LeetCode solution – In the problem “Median of Two Sorted Arrays”, we are given two sorted arrays nums1 and nums2 of size m and n respectively, and we have to return the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). Example nums1 = [1,3], …

Read more

Maximum Number of Balloons Leetcode Solution

Problem Statement In this problem, we are given a string of characters containing lower-case English letters. We need to find how many instances of the word “balloon” can we make using the characters of the given string. Example String = “banooll” 1 Explanation: String = baqwweeeertylln 0 Explanation: As the …

Read more

Valid Palindrome Leetcode Solution

Problem Statement Given a string, we have to determine if it is a palindrome, considering only alphanumeric characters i.e. numbers and alphabets only. We also have to ignore cases for alphabet characters. Example “A man, a plan, a canal: Panama” true Explanation: “AmanaplanacanalPanama”  is a valid palindrome. “race a car” …

Read more

Translate »