Interview Round DistributionClick any round below to filter
Topics:
Showing 20 of 98 results for KabbagePage 1 of 5
Coding
48
Find the majority element in an array.
Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊n / 2⌋ times. You may assume that the majority element always exists in the array.
Input: nums = [3, 2, 3]
Output: 3
Explanation: The number 3 appears 2 times, which is strictly greate…
Diameter of a Binary Tree
Find the diameter of a binary tree.
Input: root = [1,2]
Output: 1
Explanation: The longest path is simply the single edge connecting the root node to its only child.
Add Two Numbers Represented as Strings
Add two non-negative integers represented as strings.
Input: num1 = "456", num2 = "77"
Output: "533"
Explanation: Performs character-by-character addition from right to left, carrying the 1 from 6+7=13 to the next decimal place.