This file contains 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
// 1a | |
public boolean isAisleSeat(int row, int seatNumber) { | |
return seatNumber == 0 || seatNumber == SEATS_PER_ROW - 1; | |
} | |
// 1b | |
public boolean twoTogether() { | |
for(int i = 0; i < NUM_ROWS; i++) { | |
for(int j = 0; j < SEATS_PER_ROW - 1; j++) { | |
if(seats[i][j] == 0 && seats[i][j + 1] == 0) { |
This file contains 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
// 1a | |
public String extractCity(String cityZip) { | |
return CityZip.substring(0, cityZip.indexOf(',')); | |
} | |
// 1b | |
public void printNames() { | |
System.out.println(lines.get(0)); | |
for(int i = 1; i < lines.size() - 1; i++) { | |
// I forgot the -1 in the header above |
This file contains 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
// 1a | |
public static void reverseArray(int[] arr) { | |
for(int i = 0; i = arr.length / 2; i++) { | |
arr[i] = arr[i] + arr[arr.length - i - 1]; | |
arr[arr.length - i - 1] = arr[i] - arr[arr.length - i - 1]; | |
arr[i] = arr[i] - arr[arr.length - i - 1]; | |
} | |
} | |
// 1b |
This file contains 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
// 1a | |
public static int arraySum(int[] arr) { | |
int sum = 0; | |
for(int elem : arr) | |
if(elem != null) | |
sum += elem; | |
return sum; | |
} | |
// 1b |
This file contains 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
// 1a | |
public static String scrambleWord(String word) { | |
String newWord = ""; | |
for(int i = 0; i < word.length - 1; i++) { | |
if(word.charAt(i) == 'A' && word.charAt(i + 1) != 'A') { | |
newWord += word.charAt(i + 1) + word.charAt(i); | |
i++; | |
} else { | |
newWord += word.charAt(i); | |
} |
This file contains 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
// 1a | |
public DownloadInfo getDownloadInfo(String title) { | |
for(DownloadInfo elem : downloadList) { | |
if(elem.getTitle().equals(title)) { | |
return elem; | |
} | |
} | |
return null; | |
} |
This file contains 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
set noautofocus " The opposite of autofocus; this setting stops | |
" sites from focusing on an input box when they load | |
let barposition = "top" | |
set autoupdategist | |
let blacklists = ["*://www.reddit.com/*", "*://ganden.duckdns.org/*", "*://mail.google.com/*", "*://docs.google.com/*", "*://*gistboxapp.com/*", "*://www.codecademy.com/*", "*://*yappy.im/*", "*://*airtable.com/*", "*://quizlet.com/*"] |