Skip to content

Instantly share code, notes, and snippets.

View monoprosito's full-sized avatar
🐒
What's up?

Santiago Arboleda monoprosito

🐒
What's up?
View GitHub Profile
@monoprosito
monoprosito / generateSimilarString.py
Created September 6, 2020 19:03
Generate a similar string from the input
def generateSimilarString(text, maxRepeated):
mapping = dict()
similarString = ''
# Iterate over each character
for i in range(len(text)):
# Checks if the current character is different to the previous character, to re-initialze the repeated times
if (i > 0 and text[i] != text[i-1]):
mapping[text[i-1]] = 0
#include "holberton.h"
#include <stdlib.h>
/**
* free_grid - ...
* @grid: ...
* @height: ...
*
* Return: ...
*/
@monoprosito
monoprosito / main.c
Created October 15, 2019 00:26
A program to prints "#cisfun" in C.
#include "head.h"
/**
* main - Prints a fun text
*
* Return: Nothing
*/
void main(void)
{
_putchar('#');
@monoprosito
monoprosito / head.h
Created October 15, 2019 00:26
A header for a static library explanation.
int _putchar(char c);
@monoprosito
monoprosito / _putchar.c
Created October 15, 2019 00:25
A putchar script in C from @julienbarbier42
#include <unistd.h>
/**
* _putchar - writes the character c to stdout
* @c: The character to print
* @author: julienbarbier42
*
* Return: On success 1.
* On error, -1 is returned, and errno is set appropriately.
*/
@monoprosito
monoprosito / hello_world.c
Created September 22, 2019 20:17
Hello world in C
#include <stdio.h>
int main(void)
{
printf("Hello world");
return (0);
}