DEV Community

loading...

Discussion on: Day- 2 Given an integer array arr, count element x such that x + 1 is also in arr.

Collapse
mridubhatnagar profile image
Mridu Bhatnagar Author

Hey Phil, thank you for suggesting the collections.Counter approach. I am yet to check out that module. But, yes I did read it somewhere it helps in achieving efficiency.

Also, with these, I am purposefully avoiding using libraries. :)