From fc59991565bd00cd6a92d44041d840b7af1a259f Mon Sep 17 00:00:00 2001 From: Deven <63876261+devenperez@users.noreply.github.com> Date: Thu, 21 Nov 2024 19:33:42 -0500 Subject: [PATCH] Create README - LeetHub --- 2620-counter/README.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 2620-counter/README.md diff --git a/2620-counter/README.md b/2620-counter/README.md new file mode 100644 index 0000000..9cca841 --- /dev/null +++ b/2620-counter/README.md @@ -0,0 +1,34 @@ +

2620. Counter

Easy


Given an integer n, return a counter function. This counter function initially returns n and then returns 1 more than the previous value every subsequent time it is called (n, n + 1, n + 2, etc).

+ +

 

+

Example 1:

+ +
+Input: 
+n = 10 
+["call","call","call"]
+Output: [10,11,12]
+Explanation: 
+counter() = 10 // The first time counter() is called, it returns n.
+counter() = 11 // Returns 1 more than the previous time.
+counter() = 12 // Returns 1 more than the previous time.
+
+ +

Example 2:

+ +
+Input: 
+n = -2
+["call","call","call","call","call"]
+Output: [-2,-1,0,1,2]
+Explanation: counter() initially returns -2. Then increases after each sebsequent call.
+
+ +

 

+

Constraints:

+ +