Question 1: same with little variation, https://leetcode.com/problems/baseball-game/
Question 2: https://leetcode.com/problems/partition-labels/
Good luck!