<commit_before>// Time:  O(max(r, c) * wlogw)
// Space: O(w^2)

class Solution {
public:
    string findShortestWay(vector<vector<int>>& maze, vector<int>& ball, vector<int>& hole) {
        static const unordered_map<string, vector<int>> dirs = {{"u", {-1, 0}}, {"r", {0, 1}},
                                                                {"l", {0, -1}}, {"d", {1, 0}}};
        queue<node> heap;
        unordered_set<int> visited;
        heap.emplace(0, make_pair("", ball));

        while (!heap.empty()) {
            int dist = 0;
            string path;
            vector<int> node;
            tie(dist, lvalue(tie(path, node))) = heap.front();
            heap.pop();
            if (visited.count(hash(maze, node))) {
                continue;
            }

            if (node[0] == hole[0] &&
                node[1] == hole[1]) {
                return path;<commit_msg>Update the-maze-iii.cpp<commit_after>// Time:  O(max(r, c) * wlogw)
// Space: O(w^2)

class Solution {
public:
    string findShortestWay(vector<vector<int>>& maze, vector<int>& ball, vector<int>& hole) {
        static const unordered_map<string, vector<int>> dirs = {{"u", {-1, 0}}, {"r", {0, 1}},
                                                                {"l", {0, -1}}, {"d", {1, 0}}};
        priority_queue<node, vector<node>, greater<node>> heap;
        unordered_set<int> visited;
        heap.emplace(0, make_pair("", ball));

        while (!heap.empty()) {
            int dist = 0;
            string path;
            vector<int> node;
            tie(dist, lvalue(tie(path, node))) = heap.top();
            heap.pop();
            if (visited.count(hash(maze, node))) {
                continue;
            }

            if (node[0] == hole[0] &&
                node[1] == hole[1]) {
                return path;
{'fraction_non_alphanumeric': 0.17669584245076586, 'fraction_numerical': 0.016411378555798686, 'mean_word_length': 1.6165951359084407, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6302302', 'n_tokens_mistral': 589, 'n_tokens_neox': 561, 'n_words': 134}