Home
Titze's Learning Logs
Cancel

Height Checker

View Height Checker on LeetCode Statistics Time Spent Coding 5 minutes Time Complexity O(n log n) - The sort function dominates the complexity of all other operations, resulting in the O(n log n...

Monotonic Array

View Monotonic Array on LeetCode Statistics Time Spent Coding 10 minutes Time Complexity O(n log n) - In the worst case, the input array is not sorted, and the sort method must sort the array, r...

Invert Binary Tree

View Invert Binary Tree on LeetCode Statistics Time Complexity O(n) - Every node in the tree is visited, resulting in the O(n) time complexity. Space Complexity O(n) - The invertTree method is c...

Toeplitz Matrix

View Toeplitz Matrix on LeetCode Statistics Time Complexity O(n * m) - Every cell in the matrix must be seen, resulting in the O(n * m) time complexity. Space Complexity O(1) - No variables are ...

Path Sum

View Path Sum on LeetCode Statistics Time Complexity O(n) - Every node in the tree is visited, resulting in the O(n) time complexity. Space Complexity O(n) - The algorithm makes n recursive call...

Construct String from Binary Tree

View Construct String from Binary Tree on LeetCode Statistics Time Spent Coding 15 minutes Time Complexity O(n) - Every node and its children are visited, resulting in the O(n) time complexity. ...

Hamming Distance

View Hamming Distance on LeetCode Statistics Time Complexity O(n + m + k) - The algorithm iterates through all characters within both the integer inputs and their XOR representation, resulting in...

Baseball Game

View Baseball Game on LeetCode Statistics Time Spent Coding 2 minutes Time Complexity O(n) - The input list is iterated through once, resulting in the O(n) time complexity. Space Complexity O(n...

Robot Return to Origin

View Robot Return to Origin on LeetCode Statistics Time Spent Coding 3 minutes Time Complexity O(n) - The entire input list must be iterated through, resulting in the O(n) time complexity. Spac...

Number of Students Unable to Eat Lunch

View Number of Students Unable to Eat Lunch on LeetCode Statistics Time Spent Coding 15 minutes Time Complexity O(n) - The expected time complexity is some multiple of n; the multiple varies dep...