r**********d 发帖数: 510 | 1 select @@version;
Microsoft SQL Server 2012 - 11.0.2218.0 (X64)
Jun 12 2012 13:05:25
Copyright (c) Microsoft Corporation
Enterprise Evaluation Edition (64-bit) on Windows NT 6.1 (Build
7601: Service Pack 1)
CREATE TABLE coolbid
(
ID INT UNIQUE
);
GO
INSERT INTO coolbid
VALUES (1),
(2),
(3);
GO
(3 row(s) affected)
INSERT INTO coolbid
VALUES (1);
GO
Msg 2627, Level 14, State 1, Line 2
Violation of UNIQUE KEY constraint 'UQ__coolbid__3214EC26654E5167'. Cannot
insert duplic... 阅读全帖 |
|
l******9 发帖数: 579 | 2 【 以下文字转载自 Statistics 讨论区 】
发信人: light009 (light009), 信区: Statistics
标 题: count unique values in file with 1 million rows
发信站: BBS 未名空间站 (Sat Apr 12 16:11:22 2014, 美东)
I need to count the unique values in one column in EXCEL 2010.
The worksheet has 1 million rows and 10 columns. All cell values are string
or numbers.
I used the solution at Count unique values in a column in Excel
=SUMPRODUCT((A2:A1000000<>"")/COUNTIF(A2:A100000,A2:A1000000&""))
But, it runs so long time that the EXCEL is almost ... 阅读全帖 |
|
l******9 发帖数: 579 | 3 【 以下文字转载自 Statistics 讨论区 】
发信人: light009 (light009), 信区: Statistics
标 题: count unique values in file with 1 million rows
发信站: BBS 未名空间站 (Sat Apr 12 16:11:22 2014, 美东)
I need to count the unique values in one column in EXCEL 2010.
The worksheet has 1 million rows and 10 columns. All cell values are string
or numbers.
I used the solution at Count unique values in a column in Excel
=SUMPRODUCT((A2:A1000000<>"")/COUNTIF(A2:A100000,A2:A1000000&""))
But, it runs so long time that the EXCEL is almost ... 阅读全帖 |
|
l******9 发帖数: 579 | 4 【 以下文字转载自 Statistics 讨论区 】
发信人: light009 (light009), 信区: Statistics
标 题: count unique values in file with 1 million rows
发信站: BBS 未名空间站 (Sat Apr 12 16:11:22 2014, 美东)
I need to count the unique values in one column in EXCEL 2010.
The worksheet has 1 million rows and 10 columns. All cell values are string
or numbers.
I used the solution at Count unique values in a column in Excel
=SUMPRODUCT((A2:A1000000<>"")/COUNTIF(A2:A100000,A2:A1000000&""))
But, it runs so long time that the EXCEL is almost ... 阅读全帖 |
|
l******9 发帖数: 579 | 5 【 以下文字转载自 JobHunting 讨论区 】
发信人: light009 (light009), 信区: JobHunting
标 题: generate unique integer ID from columns in SQL table
发信站: BBS 未名空间站 (Fri Nov 14 17:36:46 2014, 美东)
I need to generate a new column in a table in a sql database.
the given table is:
id1 value1 value2 value3 value4
9465 387 801 1990 20
All columns are integer. All columns are integer. value1 and value2 are
always 3 digits, value3 are year value, value4 is not more than 3 digits.
I need to g... 阅读全帖 |
|
l******9 发帖数: 579 | 6 【 以下文字转载自 JobHunting 讨论区 】
发信人: light009 (light009), 信区: JobHunting
标 题: generate unique integer ID from columns in SQL table
发信站: BBS 未名空间站 (Fri Nov 14 17:36:46 2014, 美东)
I need to generate a new column in a table in a sql database.
the given table is:
id1 value1 value2 value3 value4
9465 387 801 1990 20
All columns are integer. All columns are integer. value1 and value2 are
always 3 digits, value3 are year value, value4 is not more than 3 digits.
I need to g... 阅读全帖 |
|
l******9 发帖数: 579 | 7 I need to count the unique values in one column in EXCEL 2010.
The worksheet has 1 million rows and 10 columns. All cell values are string
or numbers.
I used the solution at Count unique values in a column in Excel
=SUMPRODUCT((A2:A1000000<>"")/COUNTIF(A2:A100000,A2:A1000000&""))
But, it runs so long time that the EXCEL is almost frozen. And, it generates
25 processes in Win 7.
Are there more efficient ways to do it ?
Also, in the column, all values have for format of
AX_Y
here, A is a chara... 阅读全帖 |
|
e**********g 发帖数: 696 | 8 a unique person
unique的音标是ju开头,属于辅音 |
|
x*******2 发帖数: 456 | 9 求购sephora 20% off for non-VIB. 一次性 unique code
价格:45个包子(450伪币 市价$4.5) or $4 paypal (code发我站内信)
在sephora寄给VIB 20% off的卡片信封里,下面一张是给friends,背后有一长串
unique code, 我要购买的是这个给非VIB的code.
直接把code发我站内信,如果不留paypal,我就默认你是收包子了,会转伪币给你,
否则请留下你paypal,我收到后会转钱给你 - 一天之内
只要帖子还在,我就是要的,不用先写封信问要不要了。thanks~
禁止交易pdf/打印coupon、CVS/Staples/Kohl's coupon:
Y
胖子是免费的,收费的是服务:
Y
所求物品名称:
11/7开始的sephora 20% off for 非VIB 一次性 unique code
物品类别(coupon: mfc 等;血糖仪等):
online coupon code (请留好有code的卡片)
物品来源(报纸夹页,厂家邮寄等):
email
可接受的价格(必须明码标价,必... 阅读全帖 |
|
x*******2 发帖数: 456 | 10 求购sephora 20% off for non-VIB. 一次性 unique code
价格:45个包子(450伪币 市价$4.5) or $4 paypal (code发我站内信)
在sephora寄给VIB 20% off的卡片信封里,下面一张是给friends,背后有一长串
unique code, 我要购买的是这个给非VIB的code.
直接把code发我站内信,如果不留paypal,我就默认你是收包子了,会转伪币给你,
否则请留下你paypal,我收到后会转钱给你 - 一天之内
只要帖子还在,我就是要的,不用先写封信问要不要了。thanks~
禁止交易pdf/打印coupon、CVS/Staples/Kohl's coupon:
Y
胖子是免费的,收费的是服务:
Y
所求物品名称:
11/7开始的sephora 20% off for 非VIB 一次性 unique code
物品类别(coupon: mfc 等;血糖仪等):
online coupon code (请留好有code的卡片)
物品来源(报纸夹页,厂家邮寄等):
email
可接受的价格(必须明码标价,必... 阅读全帖 |
|
f*********m 发帖数: 726 | 11 A robot is located at the top-left corner of a m x n grid (marked ‘Start’
in the diagram below). The robot can only move either down or right at any
point in time. The robot is trying to reach the bottom-right corner of the
grid (marked ‘Finish’ in the diagram below). How many possible unique
paths are there?
Follow up for "Unique Paths":
Now consider if some obstacles are added to the grids. How many unique paths
would there be?
An obstacle and empty space is marked as 1 and 0 respectively in t... 阅读全帖 |
|
l******9 发帖数: 579 | 12 I need to generate a new column in a table in a sql database.
the given table is:
id1 value1 value2 value3 value4
9465 387 801 1990 20
All columns are integer. All columns are integer. value1 and value2 are
always 3 digits, value3 are year value, value4 is not more than 3 digits.
I need to generate a value by combining value1 to value4, suppose that it is
called "value_combine". The "value_combine" should be unique. For example,
given the different combinations... 阅读全帖 |
|
l******9 发帖数: 579 | 13 【 以下文字转载自 Database 讨论区 】
发信人: light009 (light009), 信区: Database
标 题: create a unique primary key that can be indexed IBM netezza sql
发信站: BBS 未名空间站 (Sun Nov 16 23:34:32 2014, 美东)
I need to create a unique primary key that can also be indexed in IBM
netezza sql server ?
I find that netezza does not support UNIQUE key.
Are there some ways to get around this problem ?
Thanks |
|
j********l 发帖数: 325 | 14 OO Design:
一辆车有Year, Make, Model。假设一个Dealer有很多很多车,如何才能得到每一种
unique car有多少辆。unique car的意思是说,Year, Make, Model这三个特征,只要
有一个和其他车不同,就是unique car。
转载的,不会做 |
|
x*******2 发帖数: 456 | 15 求购sephora 20% off for non-VIB. 一次性 unique code
价格:45个包子(450伪币 市价$4.5) or $4 paypal (code发我站内信)
在sephora寄给VIB 20% off的卡片信封里,下面一张是给friends,背后有一长串
unique code, 我要购买的是这个给非VIB的code.
直接把code发我站内信,如果不留paypal,我就默认你是收包子了,会转伪币给你,
否则请留下你paypal,我收到后会转钱给你 - 一天之内
只要帖子还在,我就是要的,不用先写封信问要不要了。thanks~
禁止交易pdf/打印coupon、CVS/Staples/Kohl's coupon:
Y
胖子是免费的,收费的是服务:
Y
所求物品名称:
11/7开始的sephora 20% off for 非VIB 一次性 unique code
物品类别(coupon: mfc 等;血糖仪等):
online coupon code (请留好有code的卡片)
物品来源(报纸夹页,厂家邮寄等):
email
可接受的价格(必须明码标价,必... 阅读全帖 |
|
x*******2 发帖数: 456 | 16 求购sephora 20% off for non-VIB. 一次性 unique code
价格:45个包子(450伪币 市价$4.5) or $4 paypal (code发我站内信)
在sephora寄给VIB 20% off的卡片信封里,下面一张是给friends,背后有一长串
unique code, 我要购买的是这个给非VIB的code.
直接把code发我站内信,如果不留paypal,我就默认你是收包子了,会转伪币给你,
否则请留下你paypal,我收到后会转钱给你 - 一天之内
只要帖子还在,我就是要的,不用先写封信问要不要了。thanks~
禁止交易pdf/打印coupon、CVS/Staples/Kohl's coupon:
Y
胖子是免费的,收费的是服务:
Y
所求物品名称:
11/7开始的sephora 20% off for 非VIB 一次性 unique code
物品类别(coupon: mfc 等;血糖仪等):
online coupon code (请留好有code的卡片)
物品来源(报纸夹页,厂家邮寄等):
email
可接受的价格(必须明码标价,必... 阅读全帖 |
|
x*******2 发帖数: 456 | 17 求购sephora 20% off for non-VIB. 一次性 unique code
价格:45个包子(450伪币 市价$4.5) or $4 paypal (code发我站内信)
在sephora寄给VIB 20% off的卡片信封里,下面一张是给friends,背后有一长串
unique code, 我要购买的是这个给非VIB的code.
直接把code发我站内信,如果不留paypal,我就默认你是收包子了,会转伪币给你,
否则请留下你paypal,我收到后会转钱给你 - 一天之内
只要帖子还在,我就是要的,不用先写封信问要不要了。thanks~
禁止交易pdf/打印coupon、CVS/Staples/Kohl's coupon:
Y
胖子是免费的,收费的是服务:
Y
所求物品名称:
11/7开始的sephora 20% off for 非VIB 一次性 unique code
物品类别(coupon: mfc 等;血糖仪等):
online coupon code (请留好有code的卡片)
物品来源(报纸夹页,厂家邮寄等):
email
可接受的价格(必须明码标价,必... 阅读全帖 |
|
x*******2 发帖数: 456 | 18 求购sephora 20% off for non-VIB. 一次性 unique code
价格:45个包子(450伪币 市价$4.5) or $4 paypal (code发我站内信)
在sephora寄给VIB 20% off的卡片信封里,下面一张是给friends,背后有一长串
unique code, 我要购买的是这个给非VIB的code.
直接把code发我站内信,如果不留paypal,我就默认你是收包子了,会转伪币给你,
否则请留下你paypal,我收到后会转钱给你 - 一天之内
只要帖子还在,我就是要的,不用先写封信问要不要了。thanks~
禁止交易pdf/打印coupon、CVS/Staples/Kohl's coupon:
Y
胖子是免费的,收费的是服务:
Y
所求物品名称:
11/7开始的sephora 20% off for 非VIB 一次性 unique code
物品类别(coupon: mfc 等;血糖仪等):
online coupon code (请留好有code的卡片)
物品来源(报纸夹页,厂家邮寄等):
email
可接受的价格(必须明码标价,必... 阅读全帖 |
|
x*******2 发帖数: 456 | 19 求购sephora 20% off for non-VIB. 一次性 unique code
价格:45个包子(450伪币 市价$4.5) or $4 paypal (code发我站内信)
在sephora寄给VIB 20% off的卡片信封里,下面一张是给friends,背后有一长串
unique code, 我要购买的是这个给非VIB的code.
直接把code发我站内信,如果不留paypal,我就默认你是收包子了,会转伪币给你,
否则请留下你paypal,我收到后会转钱给你 - 一天之内
只要帖子还在,我就是要的,不用先写封信问要不要了。thanks~
禁止交易pdf/打印coupon、CVS/Staples/Kohl's coupon:
Y
胖子是免费的,收费的是服务:
Y
所求物品名称:
11/7开始的sephora 20% off for 非VIB 一次性 unique code
物品类别(coupon: mfc 等;血糖仪等):
online coupon code (请留好有code的卡片)
物品来源(报纸夹页,厂家邮寄等):
email
可接受的价格(必须明码标价,必... 阅读全帖 |
|
x*******2 发帖数: 456 | 20 求购sephora 20% off for non-VIB. 一次性 unique code
价格:45个包子(450伪币 市价$4.5) or $4 paypal (code发我站内信)
在sephora寄给VIB 20% off的卡片信封里,下面一张是给friends,背后有一长串
unique code, 我要购买的是这个给非VIB的code.
直接把code发我站内信,如果不留paypal,我就默认你是收包子了,会转伪币给你,
否则请留下你paypal,我收到后会转钱给你 - 一天之内
只要帖子还在,我就是要的,不用先写封信问要不要了。thanks~
禁止交易pdf/打印coupon、CVS/Staples/Kohl's coupon:
Y
胖子是免费的,收费的是服务:
Y
所求物品名称:
11/7开始的sephora 20% off for 非VIB 一次性 unique code
物品类别(coupon: mfc 等;血糖仪等):
online coupon code (请留好有code的卡片)
物品来源(报纸夹页,厂家邮寄等):
email
可接受的价格(必须明码标价,必... 阅读全帖 |
|
w********1 发帖数: 3492 | 21 Wed, 18 Jul 2012 11:49:44 PDT
Following last week's launch of a hack that allowed users to obtain In App
Purchase content free of charge by routing their purchase requests through a
server run by a Russian hacker, Apple began taking steps to thwart the
method. The hacker has, however, continued to develop his method to skirt
around Apple's roadblocks.
One of the suggestions for a method by which Apple could improve the
security of In App Purchasing was to include a unique identifier in
validati... 阅读全帖 |
|
F****n 发帖数: 3271 | 22 I have a Oracle table with a unique column and a lot of existing data. I
want to insert new records. What is the best way to generate unique
identifiers for this column? sys_guid? I cannot use sequence and the unique
column has not used any auto-increment mechanism. |
|
l******9 发帖数: 579 | 23 【 以下文字转载自 Database 讨论区 】
发信人: light009 (light009), 信区: Database
标 题: create a unique primary key that can be indexed IBM netezza sql
发信站: BBS 未名空间站 (Sun Nov 16 23:34:32 2014, 美东)
I need to create a unique primary key that can also be indexed in IBM
netezza sql server ?
I find that netezza does not support UNIQUE key.
Are there some ways to get around this problem ?
Thanks |
|
k***t 发帖数: 276 | 24 What about this one? bloom filter?
Given constant incoming requests, each associated with a unique key,
estimate the total amount of unique requests within a period of time.
The number of keys explodes the memory. Do not touch the disk. Rough
estimation is O.K. |
|
f*********m 发帖数: 726 | 25 leetcode 上的Unique Binary Search Trees,算总的Binary Search Trees数目:
Given n, how many structurally unique BST's (binary search trees) that store
values 1...n?
可以用dp:
int dp[n+1];
memset(dp, 0, (n+1)*sizeof(int));
dp[0] = 1;
dp[1] = 1;
for (int i = 2; i <= n; i++) {
for (int j = 0; j < i; j++) {
dp[i] += dp[j]*dp[i-j-1];
}
}
return dp[n];
若是要算总的Trees数目,那应该是
dp[i] += 2*dp[j]*dp[i-j-1]吧?
既一个节点既可以出现在根的左边,又可以出现在右边? |
|
c**y 发帖数: 172 | 26 I come up with some questions when considering the following problem. A
related discussion is found here
http://stackoverflow.com/questions/1017821/find-whether-a-tree- but I didn't find the answer to my particular questions.
Problem: given two binary trees T1 (large) and T2 (small), how do we check
whether or not T2 is a subtree of T1? Brutal force solution is out of scope
of this post. Another solution is as follows. A general idea is to serialize
T1 and T2 into two arrays A(T1) and A(T2) firs... 阅读全帖 |
|
a**********0 发帖数: 422 | 27 【 以下文字转载自 Java 讨论区 】
发信人: apprentice00 (数学学徒), 信区: Java
标 题: 如何确保每次读入的字符串都是unique的
发信站: BBS 未名空间站 (Mon Jul 29 10:39:48 2013, 美东)
每次读入一个string 但是程序需要每次读入的string原先没有读入过 也就是unique的
想到了hashset 但是我的程序没有如我所愿 即使有时候读入的东西以前读到过 也照
读不误 代码如下 请帮忙指点
String result = "";
boolean flag = true;
while(true) {
for (int i = 0; i < k; i++) {
... 阅读全帖 |
|
l*********8 发帖数: 4642 | 28 从(0, 0)到(x, y) 需要走x+y步。
visit (x,y)的概率 = visit(x,y)的unique path number / 走x+y步的unique
path number |
|
w*****d 发帖数: 105 | 29 Assume there are no obstacles (Unique Path I), then the total path number is
Let P(x, y) denotes the number of unique paths through (x, y) to reach the
end, then:
P(x, y) = Paths from (0, 0) to (x, y) times paths from (x, y) to (m, n) = C(
x+y, x) * C((m-x)+(n-y), m-x).
So the probability that the robot walks through position (x, y) is P(x, y)/T.
Hope there is no misunderstanding. |
|
a***e 发帖数: 413 | 30 Given n, generate all structurally unique BST's (binary search trees) that
store values 1...n.
For example,
Given n = 3, your program should return all 5 unique BST's shown below.
1 3 3 2 1
/ / /
3 2 1 1 3 2
/ /
2 1 2 3
这种题如果没见过我很难想出来,看了答案也不知道复杂度怎么算。汗, 现在在国内
还惦记着这些题。
class Solution {
public:
vector generateTrees(int n) {
if (n==0) retur... 阅读全帖 |
|
h*********y 发帖数: 183 | 31 前几天终于得到老板批准,要开始办Perm.但有一张表,上面要求填写自己的unique
skills.我的有些unique skill set填上去,被老板拒绝了,说不是这个职位必须的
skills.让我再重新填一份上去.
请大家帮忙,有没有好的办法,工作中必须用的东西太少了,现在是Senior Data Analyst
的title. |
|
S*******s 发帖数: 10098 | 32 Unique, Unique, hope they offer some 有特色菜和平时自己在家做不好的菜.开餐馆
亏本的故事听得不少,不容易啊。
从名字分不清是什么菜系,本地川菜馆已经好几个了,粤菜也有了,淮扬菜不怎么地,
希望来个其他地方的菜系。
突然很想吃潮州菜, 这儿有地道的吗? 中国城那个脏脏的馆子不算,名字和炒的菜不
符。
在 gongren (gongren) 的大作中提到: 】 |
|
m*****s 发帖数: 52 | 33 据板上的 metalmetal 朋友说这个Unique photo是NJ最大的实体店。但我离着老远要网
购,看不见摸不着。尤其镜头这东西,一直从BHphoto买,虽然它家Claim所有的
returned镜头头送回原厂,可有一次O 的45mm 1.8 寄来盒子明显比较软(不是新的那
种笔挺笔挺的),镜头里面一颗大灰。当然他们态度好,立刻给退了,而且他们出的邮费
。但来回折腾麻烦,而且这个unique photo好像对return说的不那么坚决。急着想买
25mm 1.4 B&H一直没货,懒得等了。 |
|
a***h 发帖数: 29 | 34 SQL Server 中如何设置Unique字段.
若 *不是* 用sql语句生成table, 如何可以将某项设置Unique字段? |
|
c*****d 发帖数: 6045 | 35 to: bihai & rslgreencard
SQL> select * from v$version;
BANNER
------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE 11.2.0.4.0 Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production
5 rows selected.
SQL> create table coolbid (id number unique);
Table created.
SQL> insert into coolbid values (1);
1 row created.
SQL>... 阅读全帖 |
|
l******9 发帖数: 579 | 36 I need to create a unique primary key that can also be indexed in IBM
netezza sql server ?
I find that netezza does not support UNIQUE key.
Are there some ways to get around this problem ?
Thanks |
|
c*****t 发帖数: 520 | 37 考虑方程 Laplace u + f(u) = 0, u = u(x), x in R^N, N>=2 的ground states。
有没有比较新近和全面的关于existence and uniqueness的综述文章?
特别考虑以下情况:f(u)=g(u)u^k, k>1, g(u) changes sign on (0,infinity).
对于uniqueness of positive ground states有什么比较普遍的结果吗?
满足条件 spherically symmetric with respect to 0 and decaying as |x| goes
to infinity 的positive solution 若存在,是否肯定唯一?
请大家指教。非常感谢。 |
|
s****b 发帖数: 2039 | 38 can use programming, such as java:
make a 2D array, put excel sheet into the array.
for each value, find _ and select substring before _, put into a new array.
then for the new array, start with first value, use for loop, from i=1,if
find any value == this
value, delete that value, shift array contents one step up,reduce the
dimension by 1, increase i by 1, do it again. when i reaches 1million, put
this value into first position of a new 1D array, delete this value.
do it again with the second v... 阅读全帖 |
|
w*******r 发帖数: 349 | 39 都给出non dup observation 的count
试验了一下,这个count (unique)好像更快,但是网上没有任何文章
不知道哪位了解这个 count (unique)
另外,最快得出non-dup index 的observation 是什么方法??
多谢 |
|
w*******y 发帖数: 60932 | 40 Today I was in Banana Republic and they had a stack of coupons leftover from
Memorial Day that are now expired. However in those coupons are non
expired Virgin America 15 percent off unique codes so I took a few and
thought I would share.
I assume others have leftover coupons as well with codes they are not going
to use and I also assume there are people out there who could use these
codes. (I used someones code awhile back for some big savings so now its
time to pay it forward)
PS - I did a s... 阅读全帖 |
|
w*******y 发帖数: 60932 | 41 Look through your old emails for SquareTrade Unique Codes with expiration
dates... They don't always expire!
I have often been able to use previous months "Unique" codes that I get in
my email...
In fact I just used a couple codes from December, that were set to expire a
month ago, but still were valid.
This code is from 12/16/2011... 30% off. It hasn't been used, and I just
checked, it is valid, so good luck!
0YG36QXO007
RJ
|
|
|
|
y*******d 发帖数: 1440 | 44 我想卖的物品:
Amazon.com $40 off on select printers Coupon Code (UNIQUE)
Save $40 on select printers from Amazon.com
To claim this offer:
1. Visit this page:
http://www.amazon.com/gp/feature.html?docId=1000700611
to find eligible printers and add $40 or more of qualifying products sold by
Amazon.com in new condition to your Shopping Cart.
2. At checkout, enter the following code in the "Gift Cards & Promotional
Codes" box:
XXXX-XXXXXX-XXXXXX
Your $40 discount will be reflected i... 阅读全帖 |
|
y*******d 发帖数: 1440 | 45 我想卖的物品:
Amazon.com $40 off on select printers Coupon Code (UNIQUE)
Save $40 on select printers from Amazon.com
To claim this offer:
1. Visit this page:
http://www.amazon.com/gp/feature.html?docId=1000700611
to find eligible printers and add $40 or more of qualifying products
sold by
Amazon.com in new condition to your Shopping Cart.
2. At checkout, enter the following code in the "Gift Cards &
Promotional
Codes" box:
XXXX-XXXXXX-XXXXXX
Your $40 discount will be reflected i... 阅读全帖 |
|
e******t 发帖数: 3289 | 46 staples 20off100 coupon code,unique 8个
每个code,5包子 |
|
h******3 发帖数: 351 | 47 1373 blogged the question "unique paths" using backtracking recursion, top
down memoization, bottom-up dynamic programming.
There is also a follow up question: enumerate all possible paths.
For example, n = m = 2, all possible paths = 6, which are
(2,2)->(1,2)->(0,2)->(0,1)->(0,0)
(2,2)->(1,2)->(1,1)->(0,1)->(0,0)
(2,2)->(1,2)->(1,1)->(1,0)->(0,0)
(2,2)->(2,1)->(2,0)->(1,0)->(0,0)
(2,2)->(2,1)->(1,1)->(1,0)->(0,0)
(2,2)->(2,1)->(1,1)->(0,1)->(0,0)
is this a NP-Complete problem? |
|
k***t 发帖数: 276 | 48 1.How would you find the first unique url among the millions of url
available?
好像还有另一道题是从流中找the only duplicated URL or integer. |
|
g**********y 发帖数: 14569 | 49 这个问法不太对吧。如果是一个流,没读完你怎么能确定unique的URL? |
|
s**x 发帖数: 7506 | 50 Frequency counter for each characters,
One Counter cc for total unique char.
Scan from left to right
increase counter for that char
If this counter is 1, increase cc;
If cc == 2, record a candidate;
If cc== 3 {
Move left side till we get cc == 2;
Cc-- if one char freq is 0.
} |
|