上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 50 下一页
摘要: Given an array with n integers, you need to find if there are triplets (i, j, k) which satisfies following conditions: where we define that subarray ( 阅读全文
posted @ 2018-09-18 06:35 轻风舞动 阅读(1299) 评论(0) 推荐(0) 编辑
摘要: Given a picture consisting of black and white pixels, and a positive integer N, find the number of black pixels located at some specific row R and col 阅读全文
posted @ 2018-09-18 03:43 轻风舞动 阅读(852) 评论(0) 推荐(0) 编辑
摘要: Given a picture consisting of black and white pixels, find the number of black lonely pixels. The picture is represented by a 2D char array consisting 阅读全文
posted @ 2018-09-18 03:37 轻风舞动 阅读(1370) 评论(1) 推荐(0) 编辑
摘要: Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the characters in s can be replaced to get t. All occurrenc 阅读全文
posted @ 2018-09-18 01:51 轻风舞动 阅读(986) 评论(0) 推荐(0) 编辑
摘要: Given an Android 3x3 key lock screen and two integers m and n, where 1 ≤ m ≤ n ≤ 9, count the total number of unlock patterns of the Android lock scre 阅读全文
posted @ 2018-09-16 14:53 轻风舞动 阅读(557) 评论(0) 推荐(0) 编辑
摘要: 其中list()函数与tuple()函数接受可抚今迭代的对象(比如一个序列)作为参数,并通过浅拷贝数据来创建一个新的列表与元组.虽然字符串也是序列类型,但一般它们不用于list()与tuple().更多的情况下,它们用于在两种类型之间进行轩换,比如你需要把一个已有的元组转换成列表类型(然后你可以修改 阅读全文
posted @ 2018-09-16 08:55 轻风舞动 阅读(2721) 评论(0) 推荐(0) 编辑
摘要: https://www.hackerrank.com/challenges/minimum-swaps-2/problem Minimum Swaps II You are given an unordered array consisting of consecutive integers [1, 阅读全文
posted @ 2018-09-15 13:50 轻风舞动 阅读(1138) 评论(0) 推荐(0) 编辑
摘要: 外排序 通常来说,外排序处理的数据不能一次装入内存,只能放在读写较慢的外存储器(通常是硬盘)上。外排序通常采用的是一种“排序-归并”的策略。在排序阶段,先读入能放在内存中的数据量,将其排序输出到一个临时文件,依此进行,将待排序数据组织为多个有序的临时文件。之后在归并阶段将这些临时文件组合为一个大的有 阅读全文
posted @ 2018-09-15 13:34 轻风舞动 阅读(3657) 评论(0) 推荐(0) 编辑
摘要: How would you remove duplicate lines from a file that is much too large to fit in memory? The duplicate lines are not necessarily adjacent, and say th 阅读全文
posted @ 2018-09-15 13:22 轻风舞动 阅读(448) 评论(0) 推荐(0) 编辑
摘要: 有编号1~100个灯泡,起初所有的灯都是灭的。有100个同学来按灯泡开关,如果灯是亮的,那么按过开关之后,灯会灭掉。如果灯是灭的,按过开关之后灯会亮。 现在开始按开关。 第1个同学,把所有的灯泡开关都按一次(按开关灯的编号: 1,2,3,......100)。第2个同学,隔一个灯按一次(按开关灯的编 阅读全文
posted @ 2018-09-15 13:05 轻风舞动 阅读(1332) 评论(0) 推荐(0) 编辑
上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 50 下一页