Swift Packages For LeetCode

Rahul Goel
May 21, 2024

Want to solve LC Medium or LC Hard in less time which require you to use complex data structure?

Problem : Swift does not provide heap, queue, stack and other complex DS as part of their framework.

Solution 1: Create your own DS as part of problem every time and use, but this would take a lot of time and would change focus from real problem.

Solution 2: Use apple provided package for collections that has Heap and other DS.

Leetcode by default support Collections, just import and use that’s all.

Using Heap

References: https://github.com/apple/swift-collections

Follow me Rahul Goel for further updates.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Rahul Goel
Rahul Goel

Written by Rahul Goel

Engineering Manager - SonyLiv iOS | 11+ Year | @Sharechat, Groupon, Paytm, Myntra https://www.linkedin.com/in/therahulgoel/

No responses yet