![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
文章平均质量分 72
窗边的倒影
一日三省
展开
-
LeetCode:N-Queens II
/** Follow up for N-Queens problem. Now, instead outputting board configurations, return the total number of distinct solutions. 题目大意:N皇后问题,输入N,输出解的个数 经典题目了,皇后们横、竖、斜都不可以碰到 **/ public class Solution原创 2013-10-18 11:29:55 · 669 阅读 · 0 评论 -
LeetCode:N-Queens
/** The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. Given an integer n, return all distinct solutions to the n-queens puzzle. E原创 2013-10-18 11:31:52 · 1004 阅读 · 0 评论 -
LeetCode:Container With Most Water
/** Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find原创 2013-10-17 18:29:40 · 680 阅读 · 0 评论 -
LeetCode:Integer to Roman
/** Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. 题目大意:把一个整数变成罗马数字,输入数字是1-3999 先恶补一下罗马数字相关知识: 最常见的罗马数字就是钟表的表盘符号: I, II, III,原创 2013-10-17 19:26:25 · 572 阅读 · 0 评论 -
LeetCode:Merge Two Sorted Lists
/** * Merge two sorted linked lists and return it as a new list. * The new list should be made by splicing together the nodes of the first two lists. * * Definition for singly-linked list. * pu原创 2013-10-17 20:16:42 · 635 阅读 · 0 评论 -
LeetCode:Remove Element
/** Given an array and a value, remove all instances of that value in place and return the new length. The order of elements can be changed. It doesn't matter what you leave beyond the new length. 题目原创 2013-10-17 19:55:39 · 938 阅读 · 0 评论 -
LeetCode:Two Sum
/** Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two numbers such that they add up to the target, w原创 2013-10-17 10:16:03 · 585 阅读 · 0 评论 -
LeetCode:Divide Two Integers
/** Divide two integers without using multiplication, division and mod operator. 题目大意:算两个整数相除的结果,不能用乘号、除号、求余号 注意:提供的两个数只限制是整数,可以是正、负、零 **/ public class Solution { public int divide(int dividend,原创 2013-10-17 21:49:47 · 650 阅读 · 0 评论