• Sign Up
    Time to claim your honor
  • Training
  • Practice
    Complete challenging Kata to earn honor and ranks. Re-train to hone technique
  • Freestyle Sparring
    Take turns remixing and refactoring others code through Kumite
  • Community
  • Leaderboards
    Achieve honor and move up the global leaderboards
  • Chat
    Join our Discord server and chat with your fellow code warriors
  • Discussions
    View our Github Discussions board to discuss general Codewars topics
  • About
  • Docs
    Learn about all of the different aspects of Codewars
  • Blog
    Read the latest news from Codewars and the community
  • Log In
  • Sign Up
MathBasher Avatar
Name:Hans Gabriel B. Daduya
Clan:Central Philippine University
Skills:react, flask, node.js, docker, tensorflow
Member Since:Sep 2020
Last Seen:Oct 2024
Profiles:
    Following:63
    Followers:62
    Allies:61
    View Profile Badges
    • Stats
    • Kata
    • Collections
    • Kumite
    • Social
    • Discourse
    • Conversations (9)
    • Replies
    • Authored
    • Needs Resolution
    • Custom User Avatar
      • blinker345678
      • commented on "blinker345678's fork of MathBasher's Python solution for "Primes in numbers"" kumite
      • 5 years ago

      I have to admit I was sceptical given the clusterfuck this solution was that even I could break it down.

    • Custom User Avatar
      • hobovsky
      • commented on "blinker345678's fork of MathBasher's Python solution for "Primes in numbers"" kumite
      • 5 years ago

      Knowing maths and algorithms probably is not how this person reached 1 kyu.

    • Custom User Avatar
      • blinker345678
      • commented on "blinker345678's fork of MathBasher's Python solution for "Primes in numbers"" kumite
      • 5 years ago

      Wait, you joined this month and you're a 1 kyu already?
      I can barely skinny my way through 4kyu python problems...I guess you know maths or algorithms or something?

    • Custom User Avatar
      • blinker345678
      • commented on "blinker345678's fork of MathBasher's Python solution for "Primes in numbers"" kumite
      • 5 years ago

      If n is a power of two this will get trapped in an infinite loop until it exceeds permitted recursion depth.
      Because it will reduce down to 1 and the prime test won't catch it.

    • Custom User Avatar
      • MathBasher
      • commented on "Primes in numbers" python solution
      • 5 years ago

      My solution is longer than most but I think the idea is simply prime factorization.

    • Custom User Avatar
      • MathBasher
      • commented on "Coping with NP-Hardness #3: Finding the Minimum Hamiltonian Cycle" kata
      • 5 years ago

      This is just the travelling salesman problem. An NP-Hard problem with no polynomial time solution.

    • Custom User Avatar
      • MathBasher
      • commented on "Smallest unused ID" python solution
      • 5 years ago

      Probably the fastest and the simplest at the same time!

    • Custom User Avatar
      • MathBasher
      • commented on "Smallest unused ID" python solution
      • 5 years ago

      After seeing the solutions of others, I noticed that their time complexity is O(n**2). I think my solution is O(nlog(n)) since sorting an array takes that time and then a linear scan will check the result.

    • Custom User Avatar
      • MathBasher
      • commented on "Last digit of a huge number" python solution
      • 5 years ago

      Here's my brainfuck of a solution. Apparently I wanted to use the Chinese Remainder Theorem for modulo 10 thus giving us a simplified us something easier to compute such as (6a_1 + 5a_2) % 10 where a_1 is the remainder divided by 5 and a_2 is the remainder when divided by 2. The logic is kinda nuts and a lot of repetetive code. I'll improve on this next time.

    • © 2025 Codewars
    • About
    • API
    • Blog
    • Privacy
    • Terms
    • Code of Conduct
    • Contact

    Confirm

    • Cancel
    • Confirm

    Collect: undefined

    Loading collection data...