Skip to content

Latest commit

 

History

History
126 lines (123 loc) · 27.4 KB

mathematical-simulation-modular-arithmetic.md

File metadata and controls

126 lines (123 loc) · 27.4 KB

Mathematical Simulation & Modular Arithmetic Algorithm Problems

A curated selection of LeetCode problems solved using the Mathematical Simulation & Modular Arithmetic algorithmic approach.

Problems

# Problem Difficulty Pattern Time Space Explanation
48 Rotate Image Medium Math & Logic O(n²) O(1) Explanation
55 Jump Game Medium Math & Logic O(n) O(1) Explanation
118 Pascal's Triangle Easy Math & Logic O(n) O(1) Explanation
119 Pascal's Triangle II Easy Math & Logic O(n) O(1) Explanation
121 Best Time to Buy and Sell Stock Easy Math & Logic O(n) O(1) Explanation
123 Best Time to Buy and Sell Stock III Hard Math & Logic O(n) O(1) Explanation
128 Longest Consecutive Sequence Medium Math & Logic O(n) O(1) Explanation
223 Rectangle Area Medium Math & Logic O(n) O(1) Explanation
229 Majority Element II Medium Math & Logic O(n) O(1) Explanation
258 Add Digits Easy Math & Logic O(n) O(1) Explanation
289 Game of Life Medium Math & Logic O(n) O(1) Explanation
319 Bulb Switcher Medium Math & Logic O(n) O(1) Explanation
357 Count Numbers with Unique Digits Medium Math & Logic O(n) O(1) Explanation
365 Water and Jug Problem Medium Math & Logic O(n) O(1) Explanation
391 Perfect Rectangle Hard Math & Logic O(n) O(1) Explanation
400 Nth Digit Medium Math & Logic O(n) O(1) Explanation
448 Find All Numbers Disappeared in an Array Easy Math & Logic O(n) O(1) Explanation
482 License Key Formatting Easy Math & Logic O(n) O(1) Explanation
485 Max Consecutive Ones Easy Math & Logic O(n) O(1) Explanation
497 Random Point in Non-overlapping Rectangles Medium Math & Logic O(n) O(1) Explanation
714 Best Time to Buy and Sell Stock with Transaction Fee Medium Math & Logic O(n) O(1) Explanation
738 Monotone Increasing Digits Medium Math & Logic O(n) O(1) Explanation
796 Rotate String Easy Math & Logic O(n) O(1) Explanation
807 Max Increase to Keep City Skyline Medium Math & Logic O(n) O(1) Explanation
812 Largest Triangle Area Easy Math & Logic O(n) O(1) Explanation
836 Rectangle Overlap Easy Math & Logic O(n) O(1) Explanation
850 Rectangle Area II Hard Math & Logic O(n) O(1) Explanation
858 Mirror Reflection Medium Math & Logic O(n) O(1) Explanation
862 Shortest Subarray with Sum at Least K Hard Math & Logic O(n) O(1) Explanation
909 Snakes and Ladders Medium Math & Logic O(n) O(1) Explanation
949 Largest Time for Given Digits Medium Math & Logic O(n) O(1) Explanation
976 Largest Perimeter Triangle Easy Math & Logic O(n) O(1) Explanation
1006 Clumsy Factorial Medium Math & Logic O(n) O(1) Explanation
1041 Robot Bounded In Circle Medium Math & Logic O(n) O(1) Explanation
1093 Statistics from a Large Sample Medium Math & Logic O(n) O(1) Explanation
1201 Ugly Number III Medium Math & Logic O(n) O(1) Explanation
1250 Check If It Is a Good Array Hard Math & Logic O(n) O(1) Explanation
1295 Find Numbers with Even Number of Digits Easy Math & Logic O(n) O(1) Explanation
1344 Angle Between Hands of a Clock Medium Math & Logic O(n) O(1) Explanation
1362 Closest Divisors Medium Math & Logic O(n) O(1) Explanation
1401 Circle and Rectangle Overlapping Medium Math & Logic O(n) O(1) Explanation
1431 Kids With the Greatest Number of Candies Easy Math & Logic O(n) O(1) Explanation
1438 Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit Medium Math & Logic O(n) O(1) Explanation
1447 Simplified Fractions Medium Math & Logic O(n) O(1) Explanation
1453 Maximum Number of Darts Inside of a Circular Dartboard Hard Math & Logic O(n) O(1) Explanation
1476 Subrectangle Queries Medium Math & Logic O(n) O(1) Explanation
1515 Best Position for a Service Centre Hard Math & Logic O(n) O(1) Explanation
1610 Maximum Number of Visible Points Hard Math & Logic O(n) O(1) Explanation
1615 Maximal Network Rank Medium Math & Logic O(n) O(1) Explanation
1732 Find the Highest Altitude Easy Math & Logic O(n) O(1) Explanation
1736 Latest Time by Replacing Hidden Digits Easy Math & Logic O(n) O(1) Explanation
1796 Second Largest Digit in a String Easy Math & Logic O(n) O(1) Explanation
1837 Sum of Digits in Base K Easy Math & Logic O(n) O(1) Explanation
1844 Replace All Digits with Characters Easy Math & Logic O(n) O(1) Explanation
1945 Sum of Digits of String After Convert Easy Math & Logic O(n) O(1) Explanation
1974 Minimum Time to Type Word Using Special Typewriter Easy Math & Logic O(n) O(1) Explanation
2071 Maximum Number of Tasks You Can Assign Hard Math & Logic O(n) O(1) Explanation
2073 Time Needed to Buy Tickets Easy Math & Logic O(n) O(1) Explanation
2145 Count the Hidden Sequences Medium Math & Logic O(n) O(1) Explanation
2160 Minimum Sum of Four Digit Number After Splitting Digits Easy Math & Logic O(n) O(1) Explanation
2231 Largest Number After Digit Swaps by Parity Easy Math & Logic O(n) O(1) Explanation
2241 Design an ATM Machine Medium Math & Logic O(n) O(1) Explanation
2243 Calculate Digit Sum of a String Easy Math & Logic O(n) O(1) Explanation
2249 Count Lattice Points Inside a Circle Medium Math & Logic O(n) O(1) Explanation
2259 Remove Digit From Number to Maximize Result Easy Math & Logic O(n) O(1) Explanation
2310 Sum of Numbers With Units Digit K Medium Math & Logic O(n) O(1) Explanation
2327 Number of People Aware of a Secret Medium Math & Logic O(n) O(1) Explanation
2342 Max Sum of a Pair With Equal Sum of Digits Medium Math & Logic O(n) O(1) Explanation
2398 Maximum Number of Robots Within Budget Hard Math & Logic O(n) O(1) Explanation
2444 Count Subarrays With Fixed Bounds Hard Math & Logic O(n) O(1) Explanation
2447 Number of Subarrays With GCD Equal to K Medium Math & Logic O(n) O(1) Explanation
2470 Number of Subarrays With LCM Equal to K Medium Math & Logic O(n) O(1) Explanation
2513 Minimize the Maximum of Two Arrays Medium Math & Logic O(n) O(1) Explanation
2543 Check if Point Is Reachable Hard Math & Logic O(n) O(1) Explanation
2545 Sort the Students by Their Kth Score Medium Math & Logic O(n) O(1) Explanation
2549 Count Distinct Numbers on Board Easy Math & Logic O(n) O(1) Explanation
2553 Separate the Digits in an Array Easy Math & Logic O(n) O(1) Explanation
2558 Take Gifts From the Richest Pile Easy Math & Logic O(n) O(1) Explanation
2566 Maximum Difference by Remapping a Digit Easy Math & Logic O(n) O(1) Explanation
2582 Pass the Pillow Easy Math & Logic O(n) O(1) Explanation
2605 Form Smallest Number From Two Digit Arrays Easy Math & Logic O(n) O(1) Explanation
2607 Make K-Subarray Sums Equal Medium Math & Logic O(n) O(1) Explanation
2637 Promise Time Limit Medium Math & Logic O(n) O(1) Explanation
2654 Minimum Number of Operations to Make All Array Elements Equal to 1 Medium Math & Logic O(n) O(1) Explanation
2739 Total Distance Traveled Easy Math & Logic O(n) O(1) Explanation
2748 Number of Beautiful Pairs Easy Math & Logic O(n) O(1) Explanation
2873 Maximum Value of an Ordered Triplet I Easy Math & Logic O(n) O(1) Explanation
2928 Distribute Candies Among Children I Easy Math & Logic O(n) O(1) Explanation
3012 Minimize Length of Array Using Operations Medium Math & Logic O(n) O(1) Explanation
3111 Minimum Rectangles to Cover Points Medium Math & Logic O(n) O(1) Explanation
3115 Maximum Prime Difference Medium Math & Logic O(n) O(1) Explanation
3154 Find Number of Ways to Reach the K-th Stair Hard Math & Logic O(n) O(1) Explanation
3174 Clear Digits Easy Math & Logic O(n) O(1) Explanation
3224 Minimum Array Changes to Make Differences Equal Medium Math & Logic O(n) O(1) Explanation
3300 Minimum Element After Replacement With Digit Sum Easy Math & Logic O(n) O(1) Explanation
3317 Find the Number of Possible Ways for an Event Hard Math & Logic O(n) O(1) Explanation
3341 Find Minimum Time to Reach Last Room I Medium Math & Logic O(n) O(1) Explanation
3342 Find Minimum Time to Reach Last Room II Medium Math & Logic O(n) O(1) Explanation
3354 Make Array Elements Equal to Zero Easy Math & Logic O(n) O(1) Explanation
3378 Count Connected Components in LCM Graph Hard Math & Logic O(n) O(1) Explanation
3381 Maximum Subarray Sum With Length Divisible by K Medium Math & Logic O(n) O(1) Explanation
3411 Maximum Subarray With Equal Products Easy Math & Logic O(n) O(1) Explanation
3443 Maximum Manhattan Distance After K Changes Medium Math & Logic O(n) O(1) Explanation
3461 Check If Digits Are Equal in String After Operations I Easy Math & Logic O(n) O(1) Explanation
3463 Check If Digits Are Equal in String After Operations II Hard Math & Logic O(n) O(1) Explanation
3473 Sum of K Subarrays With Length at Least M Medium Math & Logic O(n) O(1) Explanation
3483 Unique 3-Digit Even Numbers Easy Math & Logic O(n) O(1) Explanation
3536 Maximum Product of Two Digits Easy Math & Logic O(n) O(1) Explanation
3604 Minimum Time to Reach Destination in Directed Graph Medium Math & Logic O(n) O(1) Explanation
3618 Split Array by Prime Indices Medium Math & Logic O(n) O(1) Explanation
3622 Check Divisibility by Digit Sum and Product Easy Math & Logic O(n) O(1) Explanation
3723 Maximize Sum of Squares of Digits Medium Math & Logic O(n) O(1) Explanation
3819 Rotate Non Negative Elements Medium Math & Logic O(n) O(1) Explanation
3899 Angles of a Triangle Medium Math & Logic O(n) O(1) Explanation
3968 Maximum Manhattan Distance After All Moves Medium Math & Logic O(n) O(1) Explanation
3969 Valid Subarrays With Matching Sum Digits I Medium Math & Logic O(n) O(1) Explanation
4000 Largest Integer With Given Digit Sum Easy Math & Logic O(n) O(1) Explanation
4022 K-th Digit in Infinite String Medium Math & Logic O(n) O(1) Explanation