From 125c6c7a6b1424ae255e69484b71d57860eaad69 Mon Sep 17 00:00:00 2001 From: Divya871 <66938254+Divya871@users.noreply.github.com> Date: Sun, 6 Dec 2020 18:07:26 +0530 Subject: [PATCH] Update and rename week1.md to Divya --- Week1/Count and Say/Divya | 37 ++++++++++++++++++++++++++++++++++++ Week1/Count and Say/week1.md | 1 - 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 Week1/Count and Say/Divya delete mode 100644 Week1/Count and Say/week1.md diff --git a/Week1/Count and Say/Divya b/Week1/Count and Say/Divya new file mode 100644 index 0000000..452f62a --- /dev/null +++ b/Week1/Count and Say/Divya @@ -0,0 +1,37 @@ +class Solution { +public: + string countAndSay(int n) { + if(n==1) + return "1"; + + string temp=countAndSay(n-1); //first get the result of n-1 number + + + int index=1; + int len=temp.length(); + char temp1=temp[0]; + int count=1; + string ans=""; + while(index