2025 October 25 Problems

81 views
Skip to first unread message

daryl...@gmail.com

unread,
Oct 25, 2025, 12:39:35 PMOct 25
to leetcode-meetup
Feel free to work on any of the problems you want; we'll have people present their solutions at 11:30.

Please post your solutions to this thread so others can use this as a reference.

1025. Divisor Game Easy 71.0%

3592. Inverse Coin Change Medium 50.6%


Please download and import the following iCalendar (.ics) files to your calendar system.

Anuj Patnaik

unread,
Oct 25, 2025, 12:44:36 PMOct 25
to leetcode-meetup
class Solution:
def divisorGame(self, n: int) -> bool:
return (n-1) % 2 == 1

Allen S.

unread,
Oct 25, 2025, 1:04:06 PMOct 25
to leetcode-meetup
/*
1 - loss
2 - win
any even number - wins, as it can be changed into odd, by deducting a 1
any odd number - loses, as it can only be changed into an even number
*/
func divisorGame(n int) bool {
return n % 2 == 0
}

On Saturday, October 25, 2025 at 9:39:35 AM UTC-7 daryl...@gmail.com wrote:

Chinmay Karanjkar

unread,
Oct 25, 2025, 1:39:41 PMOct 25
to leetcode-meetup
class Solution:
def divisorGame(self, n: int) -> bool:
return n % 2 == 0
On Saturday, October 25, 2025 at 9:39:35 AM UTC-7 daryl...@gmail.com wrote:

FloM

unread,
Oct 25, 2025, 1:39:47 PMOct 25
to leetcode-meetup
1025. Divisor Game Easy 71.0%
Time: O(1), Mem: O(1)
class Solution {
public:
bool divisorGame(int n) {
return (n % 2 == 0);
}
};

Carrie Lastname

unread,
Oct 25, 2025, 2:08:57 PMOct 25
to leetcode-meetup
    def divisorGame(self, n: int) -> bool:
        return n%2==0


On Saturday, October 25, 2025 at 9:39:35 AM UTC-7 daryl...@gmail.com wrote:

Carlos Green

unread,
Oct 25, 2025, 3:21:10 PMOct 25
to leetcode-meetup
var divisorGame = function(n) {
return n % 2 === 0
};

On Saturday, October 25, 2025 at 9:39:35 AM UTC-7 daryl...@gmail.com wrote:

Carrie Lastname

unread,
Oct 25, 2025, 3:41:08 PMOct 25
to leetcode-meetup
    def findCoins(self, numWays: List[int]) -> List[int]:
        ans = []
        dp = [0 for _ in range(len(numWays)+1)]
        dp[0] = 1
        while True:
            newdp = [1]
            curr = None
            for i,num in enumerate(numWays):
                if curr==None and dp[i+1] + newdp[0] == num:
                    # found new denomination
                    curr = i+1
                    ans.append(curr)
                if curr:
                    newdp.append(dp[i+1] + newdp[-curr])
                else:
                    newdp.append(dp[i+1])
            if curr == None:
                if newdp[1:] != numWays:
                    return []
                return ans                
            dp = newdp



On Saturday, October 25, 2025 at 9:39:35 AM UTC-7 daryl...@gmail.com wrote:

vinay

unread,
Oct 25, 2025, 10:52:16 PMOct 25
to leetcod...@googlegroups.com
1025. Divisor Game Easy 71.0%

Alice will always win the game if n is even.

class Solution {
    public boolean divisorGame(int n) {
        return n%2 == 0;
    }
}

--
whatspp group: http://whatsapp.techbayarea.us/
---
You received this message because you are subscribed to the Google Groups "leetcode-meetup" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leetcode-meet...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/leetcode-meetup/b07bbf79-144c-4012-a2cb-98b30c55f294n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages