Why this question even exist on Leetcode ??


  • -6
    S
    public class Solution {
        public boolean canWinNim(int n) {
            if(n<=3) 
                return true;
            if(n%4==0)
                return false;
            return true;
            
        }
    }

  • 2

    I think most of the work is reasoning why n % 4 == 0 leads to a losing game.


  • 0
    S

    I do not think this problem has any value


  • 2
    W

    I know it is bad to make this comment, but I can't help, because I really don't know why you wrote such bad code either.


  • 0
    J

    Completely and fully agree with you, dude! The code is really bad.


  • -1
    N

    Your code is terrible, but I agree that such question should not exist in Leetcode. Is it their strategy to make us buy the premium subscription?


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.