Skip to content

Instantly share code, notes, and snippets.

View saadzarook's full-sized avatar
💭
Preparations...

Sa'ad Zarook saadzarook

💭
Preparations...
View GitHub Profile
@saadzarook
saadzarook / srs.c
Created April 19, 2017 15:11
Super Reduced String
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int main() {
char s[100];
for(int i=0;i<100;i++){
scanf("%c",&s[i]);
}
@saadzarook
saadzarook / bdHR.c
Created May 4, 2017 16:04
Beautiful Days at the Movies-HackerRank Problem
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int reversed(int n){
int r,rNumber=0;;
while(n != 0)
{
r = n%10;
@saadzarook
saadzarook / MinDistancesHR.c
Created May 5, 2017 05:29
Minimum Distances -HackerRank Problem
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <stdbool.h>
int main(){
int n;
@saadzarook
saadzarook / CV-HR.c
Created May 11, 2017 10:26
Counting Valleys -HackerRank Problem
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int main() {
int n;
scanf("%d",&n);
char s[n];
for(int i=0;i<n;i++){
@saadzarook
saadzarook / JOC_HR.c
Created May 12, 2017 04:01
Jumping on Clouds - HackerRank Problem
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <stdbool.h>
int main(){
int n;
@saadzarook
saadzarook / JOCR.c
Created May 12, 2017 04:31
Jumping on the Clouds:Revisited-HackerRank Problem
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <stdbool.h>
int main(){
int n;
@saadzarook
saadzarook / PDF.c
Created May 12, 2017 11:18
Designer PDF Viewer-HackerRank Problem
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <stdbool.h>
int main(){
int *h = malloc(sizeof(int) * 26);
@saadzarook
saadzarook / Birthday.c
Created May 12, 2017 17:03
Birthday Chocolate-HackerRank Problem
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <stdbool.h>
int getWays(int squares_size, int* squares, int d, int m){
int j,k=1,t=m,sum=0,count=0;
@saadzarook
saadzarook / prisoner.c
Created May 13, 2017 04:14
Save the Prisoner ! -HackerRank Problem
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <stdbool.h>
int main() {
int t;
@saadzarook
saadzarook / CTS.c
Created May 17, 2017 15:22
Cut the sticks -HackerRank Problem
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <stdbool.h>
void quicksort(int number[],int first,int last){
int i, j, pivot, temp;