Quick actions

cmd+k|ctrl+k

Navigation

Languages

Sort colours

Snippet info

Language

Java

Visibility

public

Author

shraddharao-

Created

2024-02-28T06:44:57.896603Z

Updated

2024-02-28T06:44:57.896603Z

class Main {
    /*
    Given an array nums with n objects colored red, white, or blue, 
    sort them in-place so that objects of the same color are adjacent, 
    with the colors in the order red, white, and blue. 
    Here, we will use integers 0, 1, and 2 to represent the color red, white, 
    and blue respectively.
    
    nums = [2, 0, 2, 1, 1, 0]
    output = [0, 0, 1, 1, 2, 2]

    */
    public static void main(String[] args) {
        System.out.println("Hello World!");
    }
}
INFO