/LeetCode

LeetCode Problems' Solutions

Primary LanguageC++

LeetCode Language Progress

(2017-06-22) This repository contains my working solutions to the problems found on LeetCode.

Algorithms

Arrays

# Title Solution Time Space Difficulty Notes
66 Plus one C++ / Java O(n) O(1) Easy
349 Valid Perfect Square C++ O(n) O(n) Easy
350 Valid Perfect Square II C++ O(n) O(n) Easy

Bit Tricks

# Title Solution Time Space Difficulty Notes
371 Sum of Two Integers C++ O(log n) O(1) Easy

Design Patterns

# Title Solution Time Space Difficulty Notes
341 Flatten Nested List Iterator C++ O(1) / O(n) O(n) Medium

Dynamic Programing

# Title Solution Time Space Difficulty Notes
375 Guess Number Higher or Lower II C++ O(n^3) O(n^2) Medium

Math

# Title Solution Time Space Difficulty Notes
342 Power of Four C++ O(log n) O(1) Easy
343 Integer Break Java O(log n ) O(1) Medium
367 Valid Perfect Square C++ O( sqrt(n) ) O(1) Medium

Search

# Title Solution Time Space Difficulty Notes
347 Top K Frequent Elements C++ O(n) O(n) Medium
373 Find K Pairs with Smallest Sums C++ O(k log k) O(k) Medium
374 Guess Number Higher or Lower C++ O(log n) O(1) Easy

Strings

# Title Solution Time Space Difficulty Notes
344 Reverse String Java O( n ) O(n) Easy
345 Reverse Vowels of a String C++ O( n ) O(n) Easy

Trees and Graphs

# Title Solution Time Space Difficulty Notes
133 Clone Graph C++ O(V+E) O(V) Medium BFS