Interview Round DistributionClick any round below to filter
Topics:
Showing 20 of 105 results for AccenturePage 1 of 6
Coding
48
Longest Substring with Two Distinct Characters
Find the longest substring with at most two distinct characters.
Input: s = "ccaabbb"
Output: 5
Explanation: The substring "aabbb" contains exactly two distinct characters and has a maximum length of 5.
Sort a String by Frequency
Sort a string by the frequency of its characters.
Input: s = "cccaaa"
Output: "cccaaa" or "aaaccc"
Explanation: Both 'c' and 'a' appear three times, so sorting them by descending frequency keeps them grouped equally.
Find the median from a continuous data stream.
Implement a data structure that allows you to add integers from a continuous data stream and find the median of all elements so far efficiently.
Input: addNum(2), addNum(3), findMedian(), addNum(4), findMedian()
Output: 2.5 then 3.0
Explanation: After adding 2 and 3, the median is 2.5. Af…
Valid Word Abbreviation
Determine if a string matches a valid word abbreviation.
Input: word = "apple", abbr = "a2e"
Output: FALSE
Explanation: The abbreviation claims exactly 2 characters are skipped between 'a' and 'e', but "ppl" is actually 3 characters long.