上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 40 下一页
摘要: Pancake Sorting (M) 题目 Given an array of integers A, We need to sort the array performing a series of pancake flips. In one pancake flip we do the fol 阅读全文
posted @ 2020-08-30 09:39 墨云黑 阅读(187) 评论(0) 推荐(0) 编辑
摘要: Implement Rand10() Using Rand7() (M) 题目 Given a function rand7 which generates a uniform random integer in the range 1 to 7, write a function rand10 w 阅读全文
posted @ 2020-08-29 12:30 墨云黑 阅读(164) 评论(0) 推荐(0) 编辑
摘要: Fizz Buzz (E) 题目 Write a program that outputs the string representation of numbers from 1 to n. But for multiples of three it should output “Fizz” ins 阅读全文
posted @ 2020-08-27 09:35 墨云黑 阅读(208) 评论(0) 推荐(0) 编辑
摘要: Minimum Cost For Tickets (M) 题目 In a country popular for train travel, you have planned some train travelling one year in advance. The days of the yea 阅读全文
posted @ 2020-08-26 11:56 墨云黑 阅读(167) 评论(0) 推荐(0) 编辑
摘要: Sum of Left Leaves (E) 题目 Find the sum of all left leaves in a given binary tree. Example: 3 / \ 9 20 / \ 15 7 There are two left leaves in the binary 阅读全文
posted @ 2020-08-25 09:51 墨云黑 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Stream of Characters (H) 题目 Implement the StreamChecker class as follows: StreamChecker(words): Constructor, init the data structure with the given wo 阅读全文
posted @ 2020-08-24 10:50 墨云黑 阅读(169) 评论(0) 推荐(0) 编辑
摘要: Random Point in Non-overlapping Rectangles (M) 题目 Given a list of non-overlapping axis-aligned rectangles rects, write a function pick which randomly 阅读全文
posted @ 2020-08-23 13:38 墨云黑 阅读(160) 评论(0) 推荐(0) 编辑
摘要: Sort Array By Parity (E) 题目 Given an array A of non-negative integers, return an array consisting of all the even elements of A, followed by all the o 阅读全文
posted @ 2020-08-22 09:49 墨云黑 阅读(114) 评论(0) 推荐(0) 编辑
摘要: Reorder List (M) 题目 Given a singly linked list L: \(L_0→L_1→…→L_{n-1}→L_n\), reorder it to: \(L_0→L_n→L_1→L_{n-1}→L_2→L_{n-2}→…\) You may not modify t 阅读全文
posted @ 2020-08-21 09:32 墨云黑 阅读(163) 评论(0) 推荐(0) 编辑
摘要: Goat Latin (E) 题目 A sentence S is given, composed of words separated by spaces. Each word consists of lowercase and uppercase letters only. We would l 阅读全文
posted @ 2020-08-20 16:23 墨云黑 阅读(165) 评论(0) 推荐(0) 编辑
上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 40 下一页