Solve Sudoku using Bit Manipulation | Sudoku Solver in JAVA

Please consume this content on nados.pepcoding.com for a richer experience. It is necessary to solve the questions while watching videos, nados.pepcoding.com enables that.
NADOS also enables doubt support, career opportunities and contests besides free of charge content for learning. In this video, we explained the question Sudoku Solver using bit manipulation in data structure in Java. In this problem,
1. You are give a partially filled 9*9 2-D array(arr) which represents an incomplete Sudoku state.
2. You are required to assign the digits from 1 to 9 to the empty cells following some rules.
Rule 1 - Digits from 1-9 must occur exactly once in each row.
Rule 2 - Digits from 1-9 must occur exactly once in each column.
Rule 3 - Digits from 1-9 must occur exactly once in each 3x3 sub-array of the given 2D array.
Assumption - The given Sudoku puzzle will have a single unique solution.
Note - You have to Solve this problem using bits.
To submit the question, click here: www.pepcoding.com/resources/d...
For a better experience and more exercises, VISIT: www.pepcoding.com/resources/o...
#pepcoding #java #programming
Have a look at our result: www.pepcoding.com/placements
Follow us on our FB page: / pepcoding
Follow us on Instagram: / pepcoding
Follow us on LinkedIn: / pepcoding-education
Join us on Telegram: t.me/joinchat/UVTjJE83a-zFnPB

Пікірлер: 11

  • @aman6561
    @aman65613 жыл бұрын

    almost code krlia tha bs rows,cols and grid ki bits upate ni kri thi thank you so much sr for providing content.

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    Wow, I feel great ki kuch bache poora fayda uttha paa rhe hain

  • @aman6561

    @aman6561

    3 жыл бұрын

    @@Pepcoding Sir aaj jo aap ne Zed Shaw ki books btai na unki mne learn python the hard way pdhi thi first year me.

  • @AmanKumar-kz1rn
    @AmanKumar-kz1rn3 жыл бұрын

    sir pura question khud sey kar diya khushi resist nahi hui toh comment bhi kardiya sahi bolte they sir aap fayda toh hota hai, agar akk bar question pehle kiya ho, yeh recursion mai kiya tha toh insight thi ki kaise karna hai....

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    Padhte rahie beta

  • @abhaygupta9245
    @abhaygupta92452 жыл бұрын

    Sir Toggle operation ke baare me explain krdo smjh nhi aaya aap saari bits ko agar toggle kr rhe ho to jo number already row col aur grids me ha wo toh off ho jaayegi fir toh galat ho jaayega. Toggle operation ~ sign se hota ha aap ^(XOR ) use kr rhe ho please explain

  • @abhaygupta9245

    @abhaygupta9245

    2 жыл бұрын

    I understood on my own XOR operation helps you switch off specific bits in a number. You can use OR operation for setting a specific bit but you cannot unset it back without the help of XOR. That's why we used XOR there. Thanks Sir for the videos and resources

  • @theuntoldtree
    @theuntoldtree2 жыл бұрын

    why the base case is not (i==9 && j==9) ????

  • @Pepcoding

    @Pepcoding

    2 жыл бұрын

    If you also want doubt support, you can consume same content on nados.pepcoding.com and a social media feed where your doubts will be taken care of. It is entirely free of charge.

  • @namanjindal2044
    @namanjindal20443 жыл бұрын

    Sir what if we will not backtrack the cell in this question.

  • @ashwinnema06

    @ashwinnema06

    2 жыл бұрын

    You will not get right answer as for loop moves ahead that value if not replaced with its original value the calculation will come wrong

Келесі