Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: TheAlgorithms/Python
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: lighting9999/Python
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: patch-4
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 5 commits
  • 1 file changed
  • 2 contributors

Commits on Sep 19, 2025

  1. Optimize perfect cube detection for large numbers with modular checks…

    … and improved boundary estimation
    
    1. Added modular arithmetic checks to quickly eliminate numbers that cannot be perfect cubes:
       · Last digit check: Only digits 0-9 can be cube endings
       · Modulo 7 check: Cubes can only be 0, 1, or 6 mod 7
       · Modulo 9 check: Cubes can only be 0, 1, or 8 mod 9
    2. Improved boundary estimation for very large numbers (n > 10^18):
       · Uses logarithmic approximation to calculate a reasonable upper bound
       · Reduces the binary search space significantly for extremely large values
    3. Optimized computation in the binary search loop:
       · Added a check to avoid expensive cubic calculations for very large mid values
       · Uses integer division to prevent overflow in comparisons
    4. Enhanced test coverage with comprehensive doctests:
       · Added tests for very large numbers (up to 10^300)
       · Included edge cases and error conditions
       · Maintained compatibility with existing tests
    lighting9999 authored Sep 19, 2025
    Configuration menu
    Copy the full SHA
    0c5ef1f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9f63385 View commit details
    Browse the repository at this point in the history
  3. fix Doctests

    lighting9999 authored Sep 19, 2025
    Configuration menu
    Copy the full SHA
    015c487 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    203d358 View commit details
    Browse the repository at this point in the history

Commits on Sep 20, 2025

  1. fix perfect_cube.py

    lighting9999 authored Sep 20, 2025
    Configuration menu
    Copy the full SHA
    d35b3a6 View commit details
    Browse the repository at this point in the history
Loading