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
function rpass() { | |
if [ ! -n "$1" ]; then | |
echo "Usage: rpass noofchar count" | |
return 1 | |
fi | |
if [ ! -n "$2" ]; then | |
echo "Usage: rpass noofchar count" | |
return 1 | |
fi |
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 <algorithm> | |
#include <iostream> | |
#include <vector> | |
#include <cstring> | |
// Source: https://www.topcoder.com/community/data-science/data-science-tutorials/dynamic-programming-from-novice-to-advanced/ | |
int m=4, n=4; | |
int a[4][4] = {{1,2,3,4}, {5,6,7,8}, {9,10,11,12}, {13,14,15,16}}; | |
// int n=5,m=5; |
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 <string> | |
#include <cstdio> | |
#include <vector> | |
#include <iostream> | |
#include <algorithm> | |
#include <utility> | |
using namespace std; | |
int n,k,r,c; |
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 <sstream> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
int main(void) { | |
long long t,w,n; | |
while (cin >> t >> w >> 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
public class Q2 { | |
public static int opToInt(char data) { | |
switch(data) { | |
case '/': | |
return 10; | |
case '*': | |
return 10; | |
case '+': | |
return 8; | |
case '-': |
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
public class Queue <T> { | |
Node <T> front = null; | |
Node <T> rear = null; | |
int noOfElements = 0; | |
public void enqueue (T data) { | |
if (rear == null) { | |
front = rear = new Node<T> (data); | |
} else { | |
rear.next = new Node<T> (data); |
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 <stdlib.h> | |
int main(void) { | |
int n, i, j; | |
scanf("%d", &n); | |
int currValue, mainDiagonal=0, leadingDiagonal=0; | |
for (i = 0; i < n; i++) { | |
for (j = 0; j < n; j++) { | |
scanf("%d", &currValue); |
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 <stdlib.h> | |
int** Input_Matrix(int *rows, int *columns) { | |
printf("Input the number of rows: "); | |
scanf("%d", rows); | |
printf("Input the number of columns: "); | |
scanf("%d", columns); | |
int **arr = (int **)malloc(*rows * sizeof(int *)); |
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 <vector> | |
#include <map> | |
#include <utility> | |
using namespace std; | |
vector <int> divisors; | |
map < pair< int, pair<bool, int> >, int > DP; | |
vector<int> ans; |
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 <climits> | |
#include <cmath> | |
using namespace std; | |
int n; | |
double x, y; | |
double dist; |
OlderNewer