This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <string.h> | |
| int isHappy(char pancakes[1000]); | |
| int main(){ | |
| int n; | |
| FILE *ifp = fopen("A-large-practice.in", "r"); | |
| FILE *ofp = fopen("ouput.txt", "w"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #Count Duplicates count_duplicate.sh "abcdeaB" => 2 | |
| total=0 | |
| for letter in {a..z} ; do | |
| storage=$(echo "$1" | grep -o -i "$letter" | wc -l) | |
| if [ $storage -gt 1 ] | |
| then | |
| total=$((total+1)) | |
| fi | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " Vim color file | |
| " Maintainer: Martin Baeuml <baeuml@gmail.com> | |
| " Last Change: 2008-02-09 | |
| " | |
| " This color file is a modification of the "summerfruit" color scheme by Armin Ronacher | |
| " so that it can be used on 88- and 256-color xterms. The colors are translated | |
| " using Henry So's programmatic approximation of gui colors from his "desert256" | |
| " color scheme. | |
| " | |
| " I removed the "italic" option and the background color from |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| source $VIMRUNTIME/vimrc_example.vim | |
| source $VIMRUNTIME/mswin.vim | |
| behave mswin | |
| colorscheme summerfruit256 | |
| set guifont=Consolas:h11:cANSI | |
| set number | |
| set backupdir=~/vimtmp/backup// | |
| set directory=~/vimtmp/swap// | |
| set undodir=~/vimtmp/undo// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Jonathan Chin | |
| // 11/2/15 | |
| // My solution to the Array's Force question on Hackerearth. | |
| #include <stdio.h> | |
| int storage[1000001]; | |
| long long temp[1000001]; | |
| int main(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| // this is the greatest possible prime number to store in sieve | |
| #define MAXPRIME 50000 | |
| int storage[MAXPRIME]; | |
| int main(){ | |
| int prime[MAXPRIME]; | |
| int i; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Jonathan Chin | |
| // 11/15/2015 | |
| // Given a rod of length n inches and an array of prices that contains prices of all pieces of size smaller than n. | |
| // Determine the maximum value obtainable by cutting up the rod and selling the pieces. | |
| #include <stdio.h> | |
| #define MAX(a,b)( ((a)>(b)) ? (a) : (b)) | |
| int main() | |
| { | |
| FILE *ifp = fopen("input.txt", "r"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 4 4 | |
| 1 2 3 4 | |
| 5 6 7 8 | |
| 9 0 1 2 | |
| 9 8 7 6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Jonthan Chin | |
| // 11/15/15 | |
| // Minnimum Edit Distance algorithm which finds the minnimum | |
| //number of character insertions, deletions, or replacements to make one string equal to another string | |
| #include <stdio.h> | |
| #include <string.h> | |
| #define MIN(a,b)( ((a) > (b)) ? (b) : (a)) | |
| int main() | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Jonathan Chin | |
| // 11/15/15 | |
| // Classical Egg drop problem, using dynamic programming | |
| #include <stdio.h> | |
| #include <limits.h> | |
| #define MAX(a, b)( ((a)>(b)) ? (a) : (b)) | |
| void eggdrop(int eggs, int height); | |
| int main(){ |