题目描述:
LeetCode 407. Trapping Rain Water II
Given an m x n
matrix of positive integers representing the height of each unit cell in a 2D elevation map, compute the volume of water it is able to trap after raining ...
LeetCode 407. Trapping Rain Water II
Given an m x n
matrix of positive integers representing the height of each unit cell in a 2D elevation map, compute the volume of water it is able to trap after raining ...
LeetCode 406. Queue Reconstruction by Height
Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k)
, where h
is the height of the person and k ...
LeetCode 405. Convert a Number to Hexadecimal
Given an integer, write an algorithm to convert it to hexadecimal. For negative integer, two’s complement method is used.
IMPORTANT:
You must not use any method provided by the library which converts ...
LeetCode 404. Sum of Left Leaves
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 tree, with values 9 and 15 respectively ...
题目描述:
数字 1 - 9 中有 2 个数为“目标数”。
游戏者拥有 5 次机会,每次从1 - 9中选择 2 个数字,裁判会告知其选对的数字个数。
问题一:
求 5 次猜测中的某一次,游戏者猜对全部 2 个目标数的概率。
答案解析:
假设游戏者按照 1 2 , 3 4 , 5 6 , 7 8 的顺序猜测, 5 次猜测全部失败的情况:
情况一: 1-8 中有一个数,另一个数字是 ...