--- title: 'Part 1 Session 2' --- ###### tags: `Part 1` `Session 2` Session 2 - Arrays and Strings (UMPIRE) === ## Highlights For This Session * **Breakout session 1:** We will start with a breakout session for 5-10 minutes, with groups of 2-3, to warm up with an easy coding problem. * **Introduce The Sliding-Window-Technique**: We will then introduce one of the common techniques to solve an array/string problem * **Breakout session 2:** We will breakout for the second time where you will group into 2-3 to practice applying this technique on a new coding problem. ## Breakout session 1: (U-M-P-I-R-E) The goal for this breakout session is to practice all aspects of the UMPIRE technique end-to-end, and implementing a solution. Pick any one of the following problems to discuss in the breakout room. ### Problem 1: Write a method to convert a string representation of an integer into its equivalent integer number. For example: Input: "123" Output: 123 Input: "-6714" Ouput: -6714 ### Problem 2: Write a method that takes an integer as input and returns its string representation. For example: Input: 123 Output: "123" Input: -6714 Ouput: "-6714" ### Problem 3: Reverse the ordering of words in a sentence. **For example:** ``` Input: "The weather is amazing today!" Output: "today! amazing is weather The" ``` ## Breakout session 2: (I-R-E) The goal for this breakout session is to practice implementing a solution for a problem, review and evaluate your code with a few test cases. ### Problem Statement Given a string, find the length of the longest substring in it with no more than K distinct characters. Example 1: Input: String="araaci", K=2 Output: 4 #### Explanation: The longest substring with no more than '2' distinct characters is "araa". Example 2: Input: String="araaci", K=1 Output: 2 #### Explanation: The longest substring with no more than '1' distinct characters is "aa". Example 3: Input: String="cbbebi", K=3 Output: 5 #### Explanation: The longest substrings with no more than '3' distinct characters are "cbbeb" & "bbebi"