1957
This commit is contained in:
13
src/1957.c
Normal file
13
src/1957.c
Normal file
@@ -0,0 +1,13 @@
|
||||
#include <solution/1957.h>
|
||||
#include <string.h>
|
||||
|
||||
char *makeFancyString(char *s)
|
||||
{
|
||||
int d[26] = {0};
|
||||
int len = strlen(s);
|
||||
for (int i = len - 1; i >= 0; i--)
|
||||
if (++(d[s[i] - 'a']) > 3)
|
||||
for (int j = i; j < len - 1; j++)
|
||||
s[j] = s[j + 1];
|
||||
return s;
|
||||
}
|
||||
Reference in New Issue
Block a user