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
/** | |
* The read4 API is defined in the parent class Reader4. | |
* int read4(char[] buf); | |
*/ | |
public class Solution extends Reader4 { | |
/** | |
* @param buf Destination buffer | |
* @param n Number of characters to read | |
* @return The number of actual characters read | |
*/ |
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
public class SortColors { | |
public void sortColors(int[] nums) { | |
if(nums.length > 1) { | |
int redIndex = 0; | |
int blueIndex = nums.length-1; | |
int i = 0; | |
while(i <= blueIndex) { | |
if(nums[i] == 2) { | |
// Send blue node to end of array | |
swap(nums, i, blueIndex--); |
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
public class NumberOfIslands { | |
public int numIslands(char[][] grid) { | |
int numOfIslands = 0; | |
for (int i = 0; i < grid.length; i++) { | |
char[] row = grid[i]; | |
for (int j = 0; j < row.length; j++) { | |
if(grid[i][j] == '1') { | |
numOfIslands++; | |
scanIsland(grid, i, row, j+1); | |
scanIsland(grid, i, row, j-1); |
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
public class StringToInteger { | |
public int myAtoi(String str) { | |
int result = 0; | |
int multiplier = 1; | |
int startIndex = -1; | |
int endIndex = -1; | |
int index = 0; | |
boolean scanNumber = false; | |
boolean signAllowed = true; | |
boolean spaceAllowed = true; |
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
/** | |
* Definition for singly-linked list. | |
* public class ListNode { | |
* int val; | |
* ListNode next; | |
* ListNode(int x) { val = x; } | |
* } | |
*/ | |
public class AddTwoNumbers { | |
public ListNode addTwoNumbers(ListNode l1, ListNode l2) { |
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
226113 silly gunzTarPerm modified mode [ 'fp/invokeArgs.js', 420, 436 ] | |
226114 silly gunzTarPerm extractEntry fp/partial.js | |
226115 silly gunzTarPerm modified mode [ 'fp/partial.js', 420, 436 ] | |
226116 silly gunzTarPerm extractEntry fp/invoke.js | |
226117 silly gunzTarPerm modified mode [ 'fp/invoke.js', 420, 436 ] | |
226118 silly gunzTarPerm extractEntry fp/partialRight.js | |
226119 silly gunzTarPerm modified mode [ 'fp/partialRight.js', 420, 436 ] | |
226120 silly gunzTarPerm extractEntry fp/invertObj.js | |
226121 silly gunzTarPerm modified mode [ 'fp/invertObj.js', 420, 436 ] | |
226122 silly gunzTarPerm extractEntry fp/partition.js |