Skip to content

Instantly share code, notes, and snippets.

Avatar

Craig Rodrigues CraigRodrigues

View GitHub Profile
@CraigRodrigues
CraigRodrigues / palindrome.c
Created Aug 12, 2016
Project Euler 4 - Largest Palindrome Product
View palindrome.c
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
bool isPalindrome(int num);
int main(void)
{
@CraigRodrigues
CraigRodrigues / circular_array.c
Created Aug 4, 2016
HackerRank - Algorithms - Warmup - Circular Array Rotation
View circular_array.c
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
// https://www.hackerrank.com/challenges/circular-array-rotation
int main(void)
{
int n, k, q;
@CraigRodrigues
CraigRodrigues / timeconversion.c
Created Aug 4, 2016
HackerRank - Algorithms - Warmup - Time Conversion
View timeconversion.c
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <stdbool.h>
int main(void)
{
@CraigRodrigues
CraigRodrigues / triplets.c
Last active Aug 3, 2016
HackerRank - Algorithms - Warmup - Compare the Triplets
View triplets.c
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <stdbool.h>
int main(){
int alice_score = 0;
@CraigRodrigues
CraigRodrigues / greedy.c
Created Aug 3, 2016
CS50 Pset1 - Greedy
View greedy.c
#include <stdio.h>
#include <cs50.h>
#include <math.h>
/** Write a program that first asks the user how much change is owed
and then spits out the minimum number of coins with which said change
can be made.*/
int main(void)
{
@CraigRodrigues
CraigRodrigues / reverse.c
Last active Jul 9, 2016
Reverse String - Write a function that takes a string as input and returns the string reversed.
View reverse.c
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
char* reverseString(char* s) {
int length = 0, i = 0;
length = strlen(s);
char temp[1];
@CraigRodrigues
CraigRodrigues / degree.c
Last active Jul 8, 2016
[2016-06-27] Challenge #273 [Easy] Getting a degree (with bonus)
View degree.c
/**
* degree.c
*
* Reddit Daily Programmer Challenge #273 [EASY]
* Getting a degree
*
* https://www.reddit.com/r/dailyprogrammer/comments/4q35ip/20160627_challenge_273_easy_getting_a_degree/
*
*/
@CraigRodrigues
CraigRodrigues / whodunit.c
Created Jul 7, 2016
CS50 pset4 - "Whodunit"
View whodunit.c
/**
* whodunit.c
*
* Computer Science 50
* Problem Set 4
*
* Copies a BMP piece by piece, with slight variation.
*/
#include <stdio.h>
@CraigRodrigues
CraigRodrigues / recover.c
Created Jul 7, 2016
CS50 pset4 - "Recover"
View recover.c
/**
* recover.c
*
* Computer Science 50
* Problem Set 4
*
* Recovers JPEGs from a forensic image.
*/
#include <cs50.h>
@CraigRodrigues
CraigRodrigues / resize.c
Last active Dec 22, 2019
CS50 pset4 - "Resize"
View resize.c
/**
* resize.c
*
* Computer Science 50
* Problem Set 4
*
* Copies a BMP piece by piece, but also resizes it, just because.
*/
#include <stdio.h>
You can’t perform that action at this time.