---
title: "Discussion on \"Sorting Array of 0s, 1s and 2s\" | Hashnode"
description: "Discussion on \"Sorting Array of 0s, 1s and 2s\". One simple approach would be to find the frequency of each element(i.e. 0s, 1s and 2s) and create an array with this information. A better approach would be"
url: "https://hashnode.com/posts/sorting-array-of-0s-1s-and-2s/64a7d21cac427f04ab0b5307"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Sorting Array of 0s, 1s and 2s](https://divyanshsareen.hashnode.dev/sorting-array-of-0s-1s-and-2s?utm_source=hashnode&utm_medium=feed)

One simple approach would be to find the frequency of each element(i.e. 0s, 1s and 2s) and create an array with this information. A better approach would be

Jul 7, 2023 · 4 min read · divyanshsareen.hashnode.dev  
Read the article

-   [#array](https://hashnode.com/tag/array)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#data-structures](https://hashnode.com/tag/data-structures)
-   [#algorithms](https://hashnode.com/tag/algorithms)
-   [#dsa](https://hashnode.com/tag/dsa)

## Written by

[Divyansh Sareen](https://hashnode.com/@miracleboy)

@miracleboy · Delhi, India

  
[View profile](https://hashnode.com/@miracleboy)

Developer Intern at DeepThought

A software developer from Delhi, India. I completed my Btech in Computer Science in June of this year and I am open for any web development jobs. I am a simple guy who likes growing plants, taking longs walks and sometimes playing pokemon go :)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
