吉村 七瀬
吉村 七瀬
  • 2
  • 866
N Queen Problem in Swift . Solve the problem with function of 1 line statement !!!
After reading the book SICP. I learned how to solve the n queen problem using map , filter and reduce .
y == a[$0] is for filtering the queens at the same row.
c - $0 == abs(y-a[$0]) is for filtering the queens at the same diagonal.
You can try this code in iPad with Swift Playground. It works!
zhlédnutí: 48

Video

What are my Odds? Historical and Modern Efforts to Win at Games of Chance William Benter HD 1080P
zhlédnutí 822Před 2 lety
ICCM 2004 CUHK William Benter What are my Odds? Historical and Modern Efforts to Win at Games of Chance William Benter (born 1957) is an American professional gambler and philanthropist who focuses on horse betting. Benter earned nearly $1 billion through the development of one of the most successful analysis computer software programs in the horse racing market. [From Wiki] wiki: en.wikipedia....