Skip to content

Instantly share code, notes, and snippets.

View JohnItoo's full-sized avatar
💭
🏃 moving fast and making things.

John Ohue JohnItoo

💭
🏃 moving fast and making things.
View GitHub Profile
cd ~Path-to-repository
git add .;
git commit -m"Descriptive message";
git push origin master;
public void decideThree() {
int slizes = slices.size();
List<Integer>[] adjList = new List[slizes];
for (int i = 0; i < slizes; ++i) {
adjList[i] = new ArrayList<>();
}
boolean[] done = new boolean[maxPizzas + 1];
done[0] = true;
public void decideTwo() {
List<Integer>[] adjList = new List[maxPizzas + 1];
for (int i = 0; i <= maxPizzas; ++i) {
adjList[i] = new ArrayList<>();
}
boolean[] done = new boolean[maxPizzas + 1];
done[0] = true;
for (int i = 1; i <= maxPizzas; ++i) {
public void decideOne() {
int sliz = slices.size();
for (int i = sliz - 1; i >= 0; --i) {
if (maxPizzas - slices.get(i) < 0) continue;
maxPizzas -= slices.get(i);
solution.add(i);
}
}
public void decideOne() {
Collections.sort(slices);
int sliz = slices.size();
for (int i = sliz - 1; i >= 0; --i) {
if (maxPizzas - slices.get(i) < 0) continue;
maxPizzas -= slices.get(i);
solution.add(i);
}
}
public void parse(String filename) {
int bufferSize = 8 * 1024;
slices = new ArrayList<>();
BufferedReader bufferedReader = null;
try {
bufferedReader = new BufferedReader(new FileReader(filename), bufferSize);
String line = bufferedReader.readLine();
String[] request = line.split(" ");
maxPizzas = Integer.parseInt(request[0]);
int pizzas = Integer.parseInt(request[1]);
public static void main(String[] args) {
String[][] grid =
{
{"A", "B", "C"},
{"D", "E", "F"},
{"G", "H", "I"}
};
}
public static void main(String[] args) {
String[][] grid = {{"A", "B", "C"},
{"D", "E", "F"},
{"G", "H", "I"}};
for(int row = 0; row < 3; row++) {
System.out.println(' ');
for(int column = 0; column < 3; column++) {
System.out.print(grid[row][column] + " ");
}
}
@JohnItoo
JohnItoo / BreadthFirstSearch
Last active October 20, 2019 12:46
BreadthFirst Search Solution
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
int n;
int main() {
cin >> n;
vector<int> graph[1005];
int arr[1005];
@JohnItoo
JohnItoo / internalRelease.sh
Last active June 8, 2019 08:52
This Script uses xcode command-line tools to release an .ipa file to Itunes connect.
#!/bin/bash
#The script begins with inputing the appScheme , proposed version Number, username and App Specific Password.
#The App specific password can be gotten from appleid.apple.com. This can be used in place of your team password.
read -p "enter app scheme : `echo $'\n> '`" appScheme
read -p "Input new version number format x.y! or retain old version of same format! : `echo $'\n> '`" versionNumber
read -p read -p "Enter Username: `echo $'\n> '`" Username