diff --git a/data_structures/String/Java/Count and Say.java b/data_structures/String/Java/Count and Say.java new file mode 100644 index 00000000..599bf408 --- /dev/null +++ b/data_structures/String/Java/Count and Say.java @@ -0,0 +1,33 @@ +class Solution { + public String countAndSay(int n) { + String curr="1"; + for(int i=2;i<=n;i++) + { + StringBuilder newString=new StringBuilder(); + int c=1; + char ch=curr.charAt(0); + for(int j=1;j