05 2019 档案

摘要:题目如下: Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffe 阅读全文
posted @ 2019-05-31 16:55 seyjs 阅读(279) 评论(0) 推荐(0)
摘要:题目如下: Given N, consider a convex N-sided polygon with vertices labelled A[0], A[i], ..., A[N-1] in clockwise order. Suppose you triangulate the polygo 阅读全文
posted @ 2019-05-31 16:05 seyjs 阅读(362) 评论(0) 推荐(0)
摘要:题目如下: Given an array of scores that are non-negative integers. Player 1 picks one of the numbers from either end of the array followed by the player 2 阅读全文
posted @ 2019-05-29 15:14 seyjs 阅读(132) 评论(0) 推荐(0)
摘要:题目如下: Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n. Example: 解题思路:本题是《编程之美》上的题 阅读全文
posted @ 2019-05-29 14:34 seyjs 阅读(334) 评论(0) 推荐(0)
摘要:题目如下: Alex and Lee play a game with piles of stones. There are an even number of piles arranged in a row, and each pile has a positive integer number 阅读全文
posted @ 2019-05-28 17:26 seyjs 阅读(303) 评论(0) 推荐(0)
摘要:题目如下: In a warehouse, there is a row of barcodes, where the i-th barcode is barcodes[i]. Rearrange the barcodes so that no two adjacent barcodes are e 阅读全文
posted @ 2019-05-27 14:35 seyjs 阅读(486) 评论(0) 推荐(0)
摘要:题目如下: Students are asked to stand in non-decreasing order of heights for an annual photo. Return the minimum number of students not standing in the ri 阅读全文
posted @ 2019-05-27 14:31 seyjs 阅读(666) 评论(0) 推荐(0)
摘要:题目如下: Given an array A of positive integers (not necessarily distinct), return the lexicographically largest permutation that is smaller than A, that 阅读全文
posted @ 2019-05-27 10:07 seyjs 阅读(449) 评论(0) 推荐(0)
摘要:题目如下: Today, the bookstore owner has a store open for customers.length minutes. Every minute, some number of customers (customers[i]) enter the store, 阅读全文
posted @ 2019-05-27 10:02 seyjs 阅读(737) 评论(0) 推荐(0)
摘要:题目如下: Given a 2-dimensional grid of integers, each value in the grid represents the color of the grid square at that location. Two squares belong to t 阅读全文
posted @ 2019-05-24 15:11 seyjs 阅读(416) 评论(0) 推荐(0)
摘要:题目如下: You have N gardens, labelled 1 to N. In each garden, you want to plant one of 4 types of flowers. paths[i] = [x, y] describes the existence of a 阅读全文
posted @ 2019-05-22 11:07 seyjs 阅读(679) 评论(0) 推荐(0)
摘要:题目如下: We write the integers of A and B (in the order they are given) on two separate horizontal lines. Now, we may draw connecting lines: a straight l 阅读全文
posted @ 2019-05-21 17:49 seyjs 阅读(1342) 评论(0) 推荐(0)
摘要:题目如下: Given a list of words, each word consists of English lowercase letters. Let's say word1 is a predecessor of word2 if and only if we can add exac 阅读全文
posted @ 2019-05-21 14:38 seyjs 阅读(2000) 评论(0) 推荐(0)
摘要:题目如下: Given a string S of lowercase letters, a duplicate removal consists of choosing two adjacent and equal letters, and removing them. We repeatedly 阅读全文
posted @ 2019-05-21 14:33 seyjs 阅读(305) 评论(0) 推荐(0)
摘要:题目如下: We have a collection of rocks, each rock has a positive integer weight. Each turn, we choose the two heaviest rocks and smash them together. Sup 阅读全文
posted @ 2019-05-21 14:30 seyjs 阅读(598) 评论(0) 推荐(0)
摘要:先看一段代码: 按照C++的经验,想当然第一行输出是2,第二行是 openssh;可是实际输出却是11和"o"。最终查找资料有如下发现: 1、如果用“.”作为分隔的话,应该是String.split("\\."),不能用String.split("."); 2、如果用“|”作为分隔的话,应该是Str 阅读全文
posted @ 2019-05-15 16:07 seyjs 阅读(224) 评论(0) 推荐(0)
摘要:题目如下: Three stones are on a number line at positions a, b, and c. Each turn, you pick up a stone at an endpoint (ie., either the lowest or highest pos 阅读全文
posted @ 2019-05-12 21:35 seyjs 阅读(327) 评论(0) 推荐(0)
摘要:题目如下: On an infinite plane, a robot initially stands at (0, 0) and faces north. The robot can receive one of three instructions: "G": go straight 1 un 阅读全文
posted @ 2019-05-12 21:24 seyjs 阅读(511) 评论(0) 推荐(0)
摘要:题目如下: A boomerang is a set of 3 points that are all distinct and not in a straight line. Given a list of three points in the plane, return whether the 阅读全文
posted @ 2019-05-07 10:42 seyjs 阅读(381) 评论(0) 推荐(0)