Giter Club home page Giter Club logo

hardiknahata / leetcode_30daychallenge_may2020 Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 65 KB

Excited to take up the 30 Day LeetCode Challenge - May 2020! In this repo, I commit solutions to the challenge problems everyday for the Month of May 2020. You can see the TC and SC of the solutions in the Readme file. Question and Solution present in the code files.

C++ 100.00%
cpp code leetcode leetcode-solutions leetcode-challenge-solution leetcode-may-challenge

leetcode_30daychallenge_may2020's Introduction

Solutions to the LeetCode May 2020 Challenge

Questions are pasted in the code as comments.

S No. Problem Name Algorithm / Data Structure Time Complexity Space Complexity
1 First Bad Version Binary Search O(logn) O(1)
2 Jewels and Stones HashSet O(m+n) O(m)
3 Ransom Note MultiSet O(m+n) O(n)
4 Number Complement Bit Manipulation O(1) O(1)
5 First Unique Character in a String NA O(n) O(m)
6 Majority Element Sort O(n(logn)) O(1)
7 Cousins in Binary Tree Recursion O(n) O(1)
8 Check If It Is a Straight Line Slope Formula O(n) O(1)
9 Valid Perfect Square Binary Search O(logn) O(1)
10 Find the Town Judge HashMap O(m+n) O(n)
11 Flood Fill DFS O(n) O(n)
12 Single Element in a Sorted Array XOR O(n) O(1)
13 Remove K Digits NA O(n) O(n)
14 Implement Trie (Prefix Tree) Trie O(m*n) O(n)
15 Maximum Sum Circular Subarray Kadene's Algo O(n) O(1)
16 Odd Even Linked List Linked List O(n) O(1)
17 Find All Anagrams in a String Modified Rabin Karp O(n) O(1)
18 Permutation in String Modified Rabin Karp O(n) O(1)
19 Online Stock Span Stack O(n) O(n)
20 Kth Smallest Element in a BST Inorder Traversal O(n) O(n)
22 Sort Characters By Frequency HashMap & VectorPair O(logn) O(n)
23 Interval List Intersections NA O(m+n) O(m+n)
24 Construct Binary Search Tree from Preorder Traversal BST O(n^2) O(n)
25 Uncrossed Lines Dynamic Programming O(n) O(n)
26 Contiguous Array Dynamic Programming O(n) O(n)
27 Possible Bipartition DFS O(n) O(n)
28 Counting Bits Bit Manipulation O(logn) O(1)
29 Course Schedule Graph Coloring O(v+e) O(e)
30 K Closest Points to Origin HashMap O(n) On)
31 Edit Distance Dynamic Programming O(n) O(n)

leetcode_30daychallenge_may2020's People

Contributors

hardiknahata avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.