Skip to content

unreasonably effective

you can be sloppy, as long as you are rigorous

  • LeetCode 871: Minimum Number of Refueling Stops

    link Dynamic Programming The optimal refueling would look like a subsequence of (start, stations, target). For each station, we can find how far we can go with different number of refuelings. Then the minimum number of refuelings that gets us to the target is the answer. Time: , space: . Greedy We refuel only if…

    tanvirdotzaman

    February 21, 2025
    Uncategorized
  • LeetCode 134: Gas Station

    link Time: , space: . For a gas station, the net (gas-cost) >= 0 means we can make it to the next station. Since sum does not depend on the order of the numbers being summed up (commutativity), this also holds for a sequence of gas stations. Therefore, the sum of the nets of a…

    tanvirdotzaman

    February 21, 2025
    Uncategorized
  • LeetCode 881: Boats to Save People

    link Blind alleys The min and max required boat count must be in . Given a boat count, if in a single scan we could tell if all people can be packed we could use a binary search in that range. But, due to the weight and 2-person per boat restrictions a single sequential scan…

    tanvirdotzaman

    February 21, 2025
    Uncategorized
  • LeetCode 55: Jump Game

    link As long as all indices (possibly except last index) have positive jumps, we can reach the end. Therefore, only way we may fail to reach the end is: Some index (before the end index) has 0 jump There isn’t an earlier index from which we could jump and skip over this zero-jump index. Like…

    tanvirdotzaman

    February 20, 2025
    Uncategorized
  • LeetCode 81: Search in Rotated Sorted Array II

    link Time: , space: . If all numbers were distinct, we could find which side of pivot is on by comparing with as below. Here, with duplicates allowed, we reduce the problem to the all-distinct case by making sure .

    tanvirdotzaman

    February 20, 2025
    Uncategorized
  • LeetCode 410: Split Array Largest Sum

    link Time: , space: Observations: Given a split’s max allowed sum, as we increase max_allowed sum from max(nums) to sum(nums), can_split(max_allowed_sum) evaluates like: False, False, False, True, True, … We want the max_allowed_sum for the left-most True. Given a split’s max_allowed_sum, if we can split nums into 3 subarrays, we can also split nums into…

    tanvirdotzaman

    February 20, 2025
    Uncategorized
  • Pushing changes to github repo

    ssh-keygen -t ed25519 -C “tanvirdotzaman@gmail.com” cat ~/.ssh/id_ed25519.pub It’s under profile/settings git remote set-url origin git@github.com:mtanviru/ai.git git push -u origin main

    tanvirdotzaman

    February 19, 2025
    Uncategorized
  • Why simple questions in number theory feel inscrutable?

    Systematic methods in Calculus help solve huge swath of problems. On the other hand, reading through a book on Number Theory feels like every problem has been solved ad hoc, with ingenious insight, why? Guess: Something to do with how numbers are represented in human brain. Why the human brain perceives small numbers better?

    tanvirdotzaman

    February 19, 2025
    Uncategorized
  • Genlife

    Life: An introduction to complex systems Biology

    tanvirdotzaman

    February 8, 2025
    Uncategorized
  • মিসিরালি

    Case studies in abnormal psychology The man who mistook his wife for a hat An anthropologist on mars Sybil The center cannot hold Abnormal psychology An unquiet mind The three faces of eve The boy who was raised as a dog

    tanvirdotzaman

    February 8, 2025
    Uncategorized
Previous Page
1 … 25 26 27 28 29 30
Next Page

Blog at WordPress.com.

  • Subscribe Subscribed
    unreasonably effective

    Have a WordPress.com account? Log in now.

  • unreasonably effective
    View site in Reader
    Manage subscriptionsSign upLog in
    Report this content
    Collapse this bar