this shows TLE.
Sorting in Linear Time
hi @naazsayma123 you are using inbuilt sort function which has a time complexity of more than O(n) hence it is showing you TLE. This problem can be done in O(n) using count sort since there are only 0, 1 and 2 in the array.
PS: It is not recommended to use STL functions for challenges like these because they are for you to practice implementing these algorithms on your own.