add: 220116-CN (fix)

This commit is contained in:
Lam Haoyin 2022-01-16 09:40:14 +08:00
parent 5e66e6d130
commit fa43079db0
No known key found for this signature in database
GPG Key ID: 8C089CB1A2B7544F
3 changed files with 11 additions and 4 deletions

9
2201/220116-CN.cpp Normal file
View File

@ -0,0 +1,9 @@
/**
* Refer: 220107.cpp
*
* 382. Linked List Random Node
* Given a singly linked list, return a random node's value from the linked list. Each node must have the same probability of being chosen.
* Implement the Solution class:
* Solution(ListNode head) Initializes the object with the integer array nums.
* int getRandom() Chooses a node randomly from the list and returns its value. All the nodes of the list should be equally likely to be choosen.
*/

View File

@ -1,4 +1,2 @@
//
// Created by lamha on 16/01/2022.
//
#include <iostream>

View File

@ -3,4 +3,4 @@ PROJECT(2201)
SET(CMAKE_CXX_STANDARD 23)
ADD_EXECUTABLE(2201 220115.cpp)
ADD_EXECUTABLE(2201 220116.cpp)