Sort by

recency

|

140 Discussions

|

  • + 0 comments

    include

    using namespace std;

    string gamingArray(vector arr) { int maxVal = INT_MIN; int moves = 0;

    for (int i = 0; i < arr.size(); i++) {
        if (arr[i] > maxVal) {
            maxVal = arr[i];
            moves++;
        }
    }
    // If number of moves is odd → Bob wins first move, Andy second, etc.
    return (moves % 2 == 0) ? "ANDY" : "BOB";
    

    }

    int main() { int g; cin >> g; while (g--) { int n; cin >> n; vector arr(n); for (int i = 0; i < n; i++) cin >> arr[i]; cout << gamingArray(arr) << endl; } return 0; } Each time a player removes a “maximum element,” the rest of the array to its right disappears.

    The number of maximum updates (when a new max appears from left to right) equals the number of turns.

    If this count is odd, Bob (who starts first) makes the last move. If even, Andy wins.While you’re at it, check out the Geometry Dash Subzero new update — it’s a wild rhythm-run challenge that keeps your reflexes razor-sharp just like coding under pressure!

  • + 0 comments
    /*
     * Complete the 'gamingArray' function below.
     *
     * The function is expected to return a STRING.
     * The function accepts INTEGER_ARRAY arr as parameter.
     */
    
    string gamingArray(vector<int> arr) {
        vector<int> mx;  // vector of max values
        mx.push_back(arr[0]);
        int curr_max = arr[0];
        for (size_t i = 1; i < arr.size(); ++i) {
            if (arr[i] > curr_max) {
                curr_max = arr[i];
                mx.push_back(arr[i]);
            }
        }
        return mx.size() % 2 == 0 ? "ANDY" : "BOB";
    }
    
  • + 0 comments

    I found the XOR-based game logic fascinating — especially how a simple binary operation can determine complex outcomes. It reminded me of some custom Brawl-style mods I’ve explored, like Nulls brawl Alli and Trunk. Both characters have mind-bending abilities that reward strategic timing and counterplay. If anyone has thoughts on how XOR logic could influence ability clashes or win conditions in such mods, I’d love to hear them!

  • + 0 comments

    I found this game logic really interesting, especially how it uses XOR to determine the winner. It reminds me of the decision-making patterns in some custom Brawl-style mods I’ve explored recently. If anyone is interested in alternate game mechanics and strategies, you can check out Finx and Lumi – two unique brawler characters with special abilities designed to challenge your thinking.

    Would love to hear thoughts on how their abilities could relate to XOR-style game outcomes!

  • + 0 comments

    Just like in Minecraft Premium Apk where every move counts, Andy and Bob’s game is all about strategy! Bob starts strong, but Andy turns the tables in the first game, winning with a clever play. In the second round, Bob takes the crown. It’s a fun twist, much like crafting the perfect pickaxe in Minecraft Premium Apk—timing is everything!