## Tags » Speed

#### The white people energy

There is a simple way they showed in a museum that if you have two opposing planes of magnetism swirl in opposing directions – it would gain momentum and swell into a field. 94 more words

#### Quote of the Day | 08.07.20

Love has a speed. And it’s slower than I am. There’s a good chance it’s slower than you are. Love pauses. Love lingers. Love offers full focus and gives far more than it takes. 18 more words

#### What Does 50-mph Feel Like on a Bicycle?! One Word...

High speed warning: First of all, let me be very clear; purposely riding your bike above, say 10-mph, is inherently dangerous. Doing so above 20 is, as one would guess, more dangerous. 1,245 more words

Cycling

#### I loved playing The Need for Speed

If you’re in a group of people being chased by a bear, you only need to be faster than the slowest person in the group. But that’s not how websites work: being faster than at least one other website, or even faster than the ‘average’ website, is not a great achievement when the average website speed is frustratingly slow.

32 more words
Blog

#### 934. Shortest BridgeMedium

```class Solution {
boolean[][] visited;
int[][] dirs = new int[][]{{1, 0}, {-1, 0}, {0, 1}, {0, -1}};

public int shortestBridge(int[][] A) {
int r = A.length, c = A[0].length;
visited = new boolean[r][c];
for (int i = 0; i < A.length; i++) {
for (int j = 0; j < A[0].length; j++) {
if (A[i][j] == 1 && !visited[i][j]) {
if (island1.size() == 0)
dfs(A, i, j, island1);
else
dfs(A, i, j, island2);
}
}
}
int minPath = Integer.MAX_VALUE;
// for (int i = 0; i < island1.size(); i++)
//     for (int j = 0; j < island2.size(); j++) {
//         int[] p1 = island1.get(i);
//         int[] p2 = island2.get(j);
//         //minPath = Math.min(minPath, Math.abs(p2[0] - p1[0]) + Math.abs(p2[1] - p1[1]));
//         minPath = Math.min(minPath, Math.abs(p2[0] - p1[0]) + Math.abs(p2[1] - p1[1]) - 1);
//     }
for (int[] p1: island1)
for (int[] p2: island2)
minPath = Math.min(minPath, Math.abs(p2[0] - p1[0]) + Math.abs(p2[1] - p1[1]) - 1);

return minPath;
}

private void dfs(int[][] A, int x, int y, List<int[]> island) {
//if (x < 0 || x >= A.length || y < 0 || y >= A[0].length || A[x][y] != 1)
if (x < 0 || x >= A.length || y < 0 || y >= A[0].length || A[x][y] != 1 || visited[x][y])
return;
visited[x][y] = true;