摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
Stream of Characters (H) 题目 Implement the StreamChecker class as follows: StreamChecker(words): Constructor, init the data structure with the given wo 阅读全文
摘要:
Random Point in Non-overlapping Rectangles (M) 题目 Given a list of non-overlapping axis-aligned rectangles rects, write a function pick which randomly 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文