×

Piece of cake

 0 What is the logic behind Piece of cake problem? asked 06 Jul '17, 18:21 1 accept rate: 0%

 1 Just find the character which has occurred most in the string. Suppose it has occurred n times. So the remaining characters will be m = size of the string - n. If n = m, then answer will be yes, if not, no. answered 06 Jul '17, 18:51 4★sudip_95 755●6 accept rate: 10%
 0 I assume you are new to coding, hence i will give a code with explanation. Else, sudip has already answered it well enough. What you have to do, is something like this- while(t--) { string s; cin>>s; int i; int arr[26]; for(i=0;i<26;i++)arr[i]=0; //Initialise array. for(i=0;i
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×553

question asked: 06 Jul '17, 18:21

question was seen: 572 times

last updated: 06 Jul '17, 19:33