From 6cf97b855a09cc8b0952e5b07245198c30c96b3a Mon Sep 17 00:00:00 2001 From: Deven <63876261+devenperez@users.noreply.github.com> Date: Sun, 17 Jul 2022 13:43:09 -0400 Subject: [PATCH] Create README - LeetHub --- 38-count-and-say/README.md | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 38-count-and-say/README.md diff --git a/38-count-and-say/README.md b/38-count-and-say/README.md new file mode 100644 index 0000000..aeada5a --- /dev/null +++ b/38-count-and-say/README.md @@ -0,0 +1,39 @@ +

38. Count and Say

Medium


The count-and-say sequence is a sequence of digit strings defined by the recursive formula:

+ + + +

To determine how you "say" a digit string, split it into the minimal number of substrings such that each substring contains exactly one unique digit. Then for each substring, say the number of digits, then say the digit. Finally, concatenate every said digit.

+ +

For example, the saying and conversion for digit string "3322251":

+ +

Given a positive integer n, return the nth term of the count-and-say sequence.

+ +

 

+

Example 1:

+ +
Input: n = 1
+Output: "1"
+Explanation: This is the base case.
+
+ +

Example 2:

+ +
Input: n = 4
+Output: "1211"
+Explanation:
+countAndSay(1) = "1"
+countAndSay(2) = say "1" = one 1 = "11"
+countAndSay(3) = say "11" = two 1's = "21"
+countAndSay(4) = say "21" = one 2 + one 1 = "12" + "11" = "1211"
+
+ +

 

+

Constraints:

+ + +
\ No newline at end of file