Given an array of integers, sort the array in increasing order based on the frequency of the numbers. If multiple numbers have the same frequency, sort them in increasing order.
{
"nums": [
1,
1,
2,
2,
2,
3
]
}[
3,
1,
1,
2,
2,
2
]{
"nums": [
2,
3,
1,
3,
2
]
}[
1,
2,
2,
3,
3
]{
"nums": [
-1,
1,
-6,
4,
5,
-6,
1,
4,
1
]
}[
-1,
5,
-6,
-6,
4,
4,
1,
1,
1
]Sign in to Run Code and Submit