Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Dart #70

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Improve Dart #70

wants to merge 1 commit into from

Commits on Nov 7, 2024

  1. Improve Dart

    This version runs about 10% faster on my machine, using Dart SDK 3.5.1
    
    btw the native compiled version runs about 20% faster on my machine when I change isMunchausen to this:
    ```
    bool isMunchausen(int number, final List<int> cache) {
      for (int n = number; n > 0; n ~/= 10) {
        final digit = n.remainder(10);
        number -= cache[digit];
        if (number < 0) {
          return false;
        }
      }
      return 0 == number;
    }
    ```
    
    But I guess that would make it less comparable to other language implementations.
    eNotchy authored Nov 7, 2024
    Configuration menu
    Copy the full SHA
    0308f68 View commit details
    Browse the repository at this point in the history