Skip to content

Vanderkast/leetcode

Repository files navigation

Leetcode Solutions

This is my leetcode solutions.

Solved problems

Prefix symbol in problem number indicates program language that was used to solve problem:

  1. j - java
  2. r - rust
Problem Runtime Memory RET*
----- 2021 ----- ----- ----- -----
j496 O(n) - 89.26
j380 ~O(1) - 41.00
j704 O(log(n)) - 100
j278 O(log(n)) - 25.45
j35 O(log(n)) - 100
j129 ~O(n) - 100
j404 ~O(n) - 100
r448 O(n) - 100
r540 O(log(n)) - 100
j876 O(n) - 100
j1640 O(n) - 100
----- 2022 ----- ----- ----- -----
j1010 O(n) - 99.65
j997 O(n) - 81.43
r1009 O(n) - 100
j55 O(n) - 91.63
j102 O(n) - 34.29
j39 O(n^2) - 95.48
j458 O(1) - 95.48
j1220 O(n) - 88.24
j108 O(n) - 100
j98 O(n) - 100
j746 O(n) - 100
j121 O(n) - 93.7
j21 Merge Two Sorted Lists O(m*n) - 100
j70 Climbing Stairs O(n) - 100
j237 Delete Node in a Linked List O(n) - 100
j509 Fibonacci Number O(n) - 100
----- 2023 ----- ----- ----- -----
j392 O(n) - 88.45
j64 O(n) - 77.41
j62 O(n) - 100
j174 O(n) - 97.9
j1493 O(n) - 99.93
j209 O(n) - 100
j852 O(log(n)) - 100
j136 O(n) - 100
j389 O(n) - 45.22
j1688 O(log(n)) - 100
j1716 O(1) - 100
j606 O(1) - 100
j1287 O(1) - 100
j867 O(m*n) - 100
j343 O(1) O(1) 100
j1464 O(n) O(1) 100
j1903 Largest Odd Number in String O(n) O(1) 100
j22 Generate Parentheses O(n) O(n^2) 100
j45 Jump Game II O(n) O(1) 99.32
j1582 Special Positions in a Binary Matrix O(n^2) O(n) 99.75
j53 Maximum Subarray O(n) O(1) 100
j2482 Difference Between Ones and Zeros in Row and Column O(n) O(n) 86.73
j91 Decode Ways O(n) O(n) 100
j1436 Destination City O(n) O(1) 100
j263 Ugly Number O(n) O(1) 90.66
j242 Valid Anagram O(n) O(1) 54.57
j2353 Design a Food Rating System - O(n) 51.73
j1913 Maximum Product Difference Between Two Pairs O(n) O(1) 97.51
j661 Image Smoother O(m*n) O(m*n) 80.11
j120 Triangle O(n) O(1) 35.64
j2706 Buy Two Chocolates O(n) O(1) 100
j1637 Widest Vertical Area Between Two Points Containing No Points O(n*log(n)) O(n) 98.08
j1496 Path Crossing O(n) O(n) 100
j1758 Minimum Changes To Make Alternating Binary String O(n) O(1) 74.75
j1578 Minimum Time to Make Rope Colorful O(n) O(1) 61.18
----- 2024 ----- ----- ----- -----
j1704 Determine if String Halves Are Alike O(n) O(1) 42.07
j1347 Minimum Number of Steps to Make Two Strings Anagram O(n) O(1) 90.58
j1657 Determine if Two Strings Are Close O(n) O(1) 78.03
j2225 Find Players With Zero or One Losses O(n) O(n) 97.98
j1207 Unique Number of Occurrences O(n) O(1) 98.10
j168 Excel Sheet Column Title O(n) O(1) 100
j931 Minimum Falling Path Sum O(n) O(1) 68.64
j1289 Minimum Falling Path Sum II O(n) O(1) 96.41
(Retry) j496 Next Greater Element I O(m+n) O(n) 98.86
j198 House Robber O(n) O(1) 100
j645 Set Mismatch O(n) O(n) 97.74
j1239 Maximum Length of a Concatenated String with Unique Characters O(n) O(n) 100
j1457 Pseudo-Palindromic Paths in a Binary Tree O(n) O(n) 100
j1143 Longest Common Subsequence O(n*m) O(n*m) 67.33
j232 Implement Queue using Stacks - O(n) 100
j150 Evaluate Reverse Polish Notation O(n) O(n) 97.05
j739 Daily Temperatures O(n) O(n) 96.15
j2966 Divide Array Into Arrays With Max Difference O(n*log(n)) O(n) 99.06
j1043 Sequential Digits O(n*k) O(n) 93.17
j387 Sequential Digits O(n) O(1) 77.52
j451 Sort Characters By Frequency O(n) O(1) 99.36
j647 Palindromic Substrings O(n^2) O(n^2) 38.85
j169 Majority Element O(n) O(n) 36.34
j2108 Find First Palindromic String in the Array O(n) O(n) 100
j2971 Find Polygon With the Largest Perimeter O(n*log(n)) O(1) 98.63
j1481 Least Number of Unique Integers after K Removals O(n*log(n)) O(n) 24.79
j1642 Furthest Building You Can Reach O(n) O(n) 69.61
j2402 Meeting Rooms III O(nmlog(m)) O(n) 92.64
j231 Power of Two O(n) O(1) 100
j2149 Rearrange Array Elements by Sign O(n) O(1) 100
j268 Missing Number O(n) O(1) 100
j787 Cheapest Flights Within K Stops O(n*k) O(n) 15.82
j100 Same Tree O(n) O(1) 100
j513 Find Bottom Left Tree Value O(n) O(1) 100
j2864 Maximum Odd Binary Number O(n) O(1) 22.90
j948 Bag Of Tokens O(n*log(n)) O(1) 37.26
j1750 Minimum Length of String After Deleting Similar Ends O(n) O(1) 100
j1768 Merge Strings Alternately O(m*n) O(m*n) 100
j3005 Count Elements With Maximum Frequency O(n) O(1) 99.64
j2540 Minimum Common Value O(n) O(1) 96.67
j349 Intersection of Two Arrays O(n) O(1) 100
j1071 Greatest Common Divisor of Strings O(n) O(1) 70.20
r2530 Maximal Score After Applying K Operations O(nlog(n)+klog(n)) O(n) 100
r2938 Separate Black and White Balls O(n) O(1) 40
----- 2025 ----- ----- ----- -----
r3169 Count Days Without Meetings O(n^2*log(n)) O(n) 91.67
j2140 Solving Questions With Brainpower O(n) O(n) 47.50
r2873 Maximum Value of an Ordered Triplet I O(n^3) O(1) 100
r2874 Maximum Value of an Ordered Triplet II O(n) O(n) 100
j1123 Lowest Common Ancestor of Deepest Leaves O(n) O(n) 100
j416 Partition Equal Subset Sum O(n*total) O(total) 90.95
r3396 Minimum Number of Operations to Make Elements in Array Distinct O(n) O(1) 100
r1431 Kids With the Greatest Number of Candies O(n) O(n) 100
j3375 Minimum Operations to Make Array Values Equal to K O(n) O(1) 100
r3272 Find the Count of Good Integers --- --- 20
r1992 Count Good Numbers O(n) O(1) 100
j1534 Count Good Triplets O(n^3) O(1) 95.55
j2537 Count the Number of Good Subarrays O(n) O(n) 74.42
r38 Count and Say O(2^n) O(2^n) 100
----- 2026 ----- ----- ----- -----
r961 N-Repeated Element in Size 2N Array O(n) O(n) 100
j1339. Maximum Product of Splitted Binary Tree O(n) O(1) 99.22
j1975. Maximum Matrix Sum O(n) O(1) 75.46
j1458. Max Dot Product of Two Subsequences O(n*m) O(n*m) 45.19
j865. Smallest Subtree with all the Deepest Nodes O(n) O(n) 100
j712. Minimum ASCII Delete Sum for Two Strings O(n*m) O(n*m) 84.35
j1266. Minimum Time Visiting All Points O(n) O(1) 95.28

*RET - Relative Execution Time. How many percents my solution beats others' by performance.

About

My leetcode problem solutions.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published