How to get distinct values in a grid
Clarice Bouwer
Posted on June 29, 2023
def get_distinct_values(values):
return list(set(filter(lambda x: x != 0, values)))
This code will get a distinct list where values are not equal to zero. I used this code in a Sudoku solver algorithm.
💖 💪 🙅 🚩
Clarice Bouwer
Posted on June 29, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.