darekfive icon

Untitled

darekfive | PRO | 03/15/25 06:21:53 PM UTC | 0 ⭐ | 14183 👁️ | Never ⏰ | []
Java |

1.91 KB

|

None

|

0 👍

/

0 👎

class Solution {
    int[][] dirs = {{-1,-1}, {-1,0}, {-1,1}, {0,-1}, {0,1}, {1, -1}, {1, 0} , {1,1}};
    public int shortestPathBinaryMatrix(int[][] grid) {
        //bfs
        int m = grid.length;
        if (m == 1) return grid[0][0] == 0 ? 1 : -1; //1x1 edge case
        if (grid[0][0] == 1) return -1; //invalid start
        Queue<int[]> q = new ArrayDeque<>();
        grid[0][0] = 1; //mark visited
        q.offer(new int[] {0,0});
        HashMap<Integer,Integer> parent = new HashMap<>();
        int level = 1;
        while (!q.isEmpty()) {
            int size = q.size();
            for (int i =0; i < size ;i++) {
                int[] cur = q.poll();
                for (int[] d : dirs) {
                    int x = d[0] + cur[0];
                    int y = d[1] + cur[1];
                    if (x >= 0 && x < m && y >= 0 && y < m && grid[x][y] == 0) {
                        parent.put(x*1000+y, cur[0] *1000 + cur[1]);
                        if (x == m-1 && y == m-1) {
                            outputPath(x*1000+y, parent);
                            return level + 1;
                        }
                        grid[x][y] = 1;//mark visited
                        q.offer(new int[] {x,y});
                    }
                }
            }
            level++;
        }
        return -1;
    }
    void outputPath(int key, HashMap<Integer,Integer> map) {
        StringBuilder sb = new StringBuilder();
        List<String> path = new ArrayList<>();
        while (map.containsKey(key)) {
            sb.append("[")
            .append(key/1000)
            .append(",")
            .append(key%1000)
            .append("]");
            path.add(sb.toString());
            sb.setLength(0);
            key = map.get(key);
        }
        path.add("[0,0]");
        Collections.reverse(path);
        System.out.println(String.join("->", path));
    }

Comments

  • Ravgarin icon
    03/29/26 09:54:44 PM UTC
    CSS |

    0 B

    |

    0 👍

    /

    0 👎

    ✅ Leaked Exploit Documentation:
     
    https://docs.google.com/document/d/1dOCZEHS5JtM51RITOJzbS4o3hZ-__wTTRXQkV1MexNQ/edit?usp=sharing
     
    This made me $13,000 in 2 days.
     
    Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 25% — they will simply correct the exchange rate.
    The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
     
    Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from SimpleSwap — instant swap).
    
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎