Given a time represented in the format “HH:MM”, Form the next closest time by reusing the current digits. There is no limit on how many times a digit can be reused. You may assume the given input string is always valid. For example, “01:34”, “12:09” are all valid. “1:34”, “12:9” are all invalid.
An anagram is produced by rearranging the letters of first String into another String. Therefore, if String t is an anagram of String s, sorting both strings will result in two identical strings.
Given a string s, find the length of the longest substring t that contains at most 2 distinct characters.
Given a string s, find the length of the longest substring without repeating characters.
MEDIUM Given an array of characters chars, compress it using the following algorithm: Begin with an empty string s. For each group of consecutive repeating characters in chars: If the group’s length is 1, append […]