I know I can split this problem into multiple parts, and that each part has an individual solution. but I\'m wondering if there\'s a faster way to do it all together.