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
| def coinChange(coins, amount): | |
| def solve(amt): | |
| if amt < 0: | |
| return float('inf') | |
| if amt == 0: | |
| return 0 | |
| if amt in memo: | |
| return memo[amt] | |
| ans = float('inf') | |
| for c in coins: |
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 <iostream> | |
| #include <queue> | |
| using namespace std; | |
| enum COLOR { RED, BLACK }; | |
| class Node { | |
| public: | |
| int val; | |
| COLOR color; |
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 <bits/stdc++.h> | |
| using namespace std; | |
| struct node {int key; struct node *left, *right;}; | |
| struct node* newNode(int item) | |
| { | |
| struct node* temp | |
| = (struct node*)malloc(sizeof(struct node)); |
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 | |
| url_encode() { | |
| awk 'BEGIN { | |
| for (n = 0; n < 125; n++) { | |
| m[sprintf("%c", n)] = n | |
| } | |
| n = 1 | |
| while (1) { | |
| s = substr(ARGV[1], n, 1) | |
| if (s == "") { |
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
| /* | |
| { string s[30]; | |
| for(int i=0 ; cin.peek()!='\n';++i){ | |
| cin>>s[i];cout<<s[i]<<endl;} | |
| */ | |
| //******************************* | |
| /* | |
| string s[30]; | |
| int i=0; |
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
| -- phpMyAdmin SQL Dump | |
| -- version 3.5.2.2 | |
| -- http://www.phpmyadmin.net | |
| -- | |
| -- Host: 127.0.0.1 | |
| -- Generation Time: Apr 08, 2013 at 02:48 PM | |
| -- Server version: 5.5.27 | |
| -- PHP Version: 5.4.7 | |
| SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; |
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
| # Uses python3 | |
| import array as arr | |
| def summ(ara,t): | |
| s=0 | |
| for i in range (0,t): | |
| s=s+ara[i] | |
| return s | |
| def fiboH(n): |
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
| import array as arr | |
| def fiboH(n,m): | |
| ar=arr.array('L',[0]) | |
| ar.append(1) | |
| p=-1 | |
| a=0 | |
| b=1 | |
| for i in range (2,n+1): | |
| c=b+a |
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 <iostream> | |
| int64_t GCD(int64_t a, int64_t b){ | |
| if(b==0) | |
| return a; | |
| a=a%b; | |
| return GCD(b,a); | |
| } | |
| int main() { | |
| int64_t a, b; | |
| std::cin >> a >> b; |
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 <iostream> | |
| int64_t gcd(int64_t a, int64_t b) { | |
| if(b==0) | |
| return a; | |
| a=a%b; | |
| return gcd(b,a); | |
| } | |
| int main() { | |
| int64_t a, b; | |
| std::cin >> a >> b; |
NewerOlder