- Problem - Given an array num with n objects coloured red, white, or blue, sort them in place so that objects of the same colour are adjacent, with the colours in the order red, white, and blue. We will use the integers 0, 1, and 2 to represent the colours red, white, and blue, respectively. You must solve this problem without using the library's sort function.
- Solution - For this problem, we will use the Dutch National Flag algorithm. The Dutch National Flag algorithm, also known as 3-way partitioning, is an algorithm for sorting an array containing three distinct values.