摘要:
Description:Then-queens puzzle is the problem of placingnqueens on ann×nchessboard such that no two queens attack each other.Given an integern, return... 阅读全文
摘要:
Description:Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.n皇后问题:每两个皇后之间不能... 阅读全文
摘要:
Description:Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?在不借助辅助空间的情况下判断一个链表是否存在回路。可以用两个... 阅读全文
摘要:
Description:Given a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3retur... 阅读全文