From fa43079db05d6f912c25e005efe668b3f7e2673b Mon Sep 17 00:00:00 2001 From: Lam Haoyin Date: Sun, 16 Jan 2022 09:40:14 +0800 Subject: [PATCH] add: 220116-CN (fix) --- 2201/220116-CN.cpp | 9 +++++++++ 2201/220116.cpp | 4 +--- 2201/CMakeLists.txt | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 2201/220116-CN.cpp diff --git a/2201/220116-CN.cpp b/2201/220116-CN.cpp new file mode 100644 index 0000000..3b94767 --- /dev/null +++ b/2201/220116-CN.cpp @@ -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. + */ diff --git a/2201/220116.cpp b/2201/220116.cpp index 324b29a..7f51ced 100644 --- a/2201/220116.cpp +++ b/2201/220116.cpp @@ -1,4 +1,2 @@ -// -// Created by lamha on 16/01/2022. -// +#include diff --git a/2201/CMakeLists.txt b/2201/CMakeLists.txt index 081edd4..aefcd37 100644 --- a/2201/CMakeLists.txt +++ b/2201/CMakeLists.txt @@ -3,4 +3,4 @@ PROJECT(2201) SET(CMAKE_CXX_STANDARD 23) -ADD_EXECUTABLE(2201 220115.cpp) \ No newline at end of file +ADD_EXECUTABLE(2201 220116.cpp) \ No newline at end of file